Java II concepts

Description

Study material for my level 2 Java course.
David McKee
Flashcards by David McKee, updated more than 1 year ago
David McKee
Created by David McKee about 6 years ago
8
0

Resource summary

Question Answer
Which 'List' data structure is most efficient when primarily adding to the beginning of a list. LinkedList ---------------- Linked Node lists can have HEAD and TAIL pointers which makes insertion in those locations O(1) Constant Time operations.
Which 'List' data structure is most efficient when primarily adding to the beginning AND end of a list. LinkedList ---------------- Linked Node lists can have HEAD and TAIL pointers which makes insertion in those locations O(1) Constant Time operations.
What is the "Big O" runtime efficiency of inserting at the beginning of an ArrayList. O(n) ---------------- Any time you insert into an Array based List, in any location besides the END, you will need to shuffle elements, causing the list to iterate the list.
What is the "Big O" runtime efficiency of inserting "anywhere" into an ArrayList. O(n) ---------------- Any time you insert into an Array based List, in any location besides the END, you will need to shuffle elements, causing the list to iterate the list.
What is the "Big O" runtime efficiency of inserting at the end of an ArrayList. O(1) Constant Time
What is the "Big O" runtime efficiency of inserting "anywhere" into an LinkedList. O(n) ---------------- Any time you insert into an Link Node based List, in any location besides the HEAD or TAIL, you will need to iterate over the list to find the location of the insertion.
What is the "Big O" runtime efficiency of inserting at the head of a LinkedList. O(1) Constant Time
What is the "Big O" runtime efficiency of inserting at the tail of a LinkedList. O(1) Constant Time
What is "Big O" notation used for? "Big O" is used to determine runtime efficiency of algorithms
True or False: A class that implements an interface must provide an implementation of ALL the methods of that interface. True
True or False: Interfaces have no state and can not be instantiated. True
True or False: A Concrete class that extends an Abstract class must have an implementation for ALL methods in the Abstract class. False ---------------- Abstract classes are extended (which means more methods are added by - and specific to - the concrete class), and the methods on the Abstract can be overridden, but are not required to be implemented.
How is a new Iterator created? myList.iterator(); ---------------- A new instance of an iterator needs to be created by calling it as if it were a method on the data structure. You cannot use 'new iterator()' like you would for most Object instantiation.
True or False: Abstract classes may contain state (data members) and/or implementation (methods). True
True or False: Abstract classes can be inherited without implementing the abstract methods. True
True or False: Polymorphism in Java has two types: Compile time polymorphism (static binding) and Runtime polymorphism (dynamic binding) True ---------------- Method overLOADING is an example of static polymorphism, while method overRIDING is an example of dynamic polymorphism.
__________ means there are several methods present in a class having the same name but different types/order/number of parameters. Overloading ---------------- Example 1: public int add(int x, int y) public int add(int x, int y, int z) Example 2: public int add(int x, int y) public String add(String x, String y)
___________ means that a method in a subclass takes precedence over it's super classes' definition of the same method. Overriding ---------------- 'Vehicle' class has move() that prints "vehicle has moved." 'Van' (extends vehicle and) has an @override move() that prints "van has moved." IF an object of type Van envokes move(), "this is van." is the one envoked.
True or False: More than one interface can be implemented on a class. True ---------------- Notes: More than one interface can be implemented on a class. A class can only derive from a single abstract base class.
True or False: A class can only derive from a single abstract base class. True ---------------- Notes: More than one interface can be implemented on a class. A class can only derive from a single abstract base class.
Show full summary Hide full summary

Similar

Computing Hardware - CPU and Memory
ollietablet123
SFDC App Builder 2
Parker Webb-Mitchell
Data Types
Jacob Sedore
Intake7 BIM L1
Stanley Chia
Software Processes
Nurul Aiman Abdu
Design Patterns
Erica Solum
CCNA Answers – CCNA Exam
Abdul Demir
Abstraction
Shannon Anderson-Rush
Spyware
Sam2
HTTPS explained with Carrier Pigeons
Shannon Anderson-Rush
Data Analytics
anelvr