Data Structures and Java

xazucicu's version from 2015-05-20 00:43


Question Answer
What is a overloaded method?Methods with the same name but different characteristics, such as different type of parameters, different parameter order and/or amount
Define Overidingmethod with the same name and characteristics of super method
BlackBox testingtesting an application without knowing the internal structure of the code.Only what it does is known.
Whitebox testingtesting an applications internal structure
Boundary conditions?The max and min range of the solutions of a problem; Testing the "edges" which is where the issue most likely will occur
What is encapsulation?1 of 4 OOP concepts. Technique of making fields private and only allowing access through public methods (accessors and mutator Methods)
Define InheritanceA class derived from another class; Subclass; Subclasses can access and reuse fields from the super class. Constructors are not inherited
What is an interface?It is a collection of abstract methods; Interfaces are implemented; the class which implements must define the abstract methods; No constructors; No fields other than static and final
What is a Deep Copy?Copies the member values from one object onto another; Different memory location from original.
Define shallow copysimply copies the reference and not the actual values. So the original and copy are in the same memory address
describe an Is-A relationshipIt is an inheritance relationship
Describe a Has-A relationshipCreating instances of a class
Name two type of class referencessuper and this
What is the super referencesuper is used to specify the members in the parent class.
describe the this referencethis is used to specify the members of the current class
What does InstanceOf keyword doCan be used to test if an object is an instance of a specified object (Ex: child instanceOf parent returns true)
What is a checked exceptionan exception which can't be ignored and must be handled by either catching or throwing the exception
What is a RunTimeExceptionThese errors are ignored by the compiler
Name three exceptionsNumberFormatException, NullPointerException, Arithmetic Exception
Describe a NumberFormatExceptionExtends IllegalArgument Exception; Thrown to indicate an attempt to convert non numerical string to a numeric type
Describe a NullPointerExeptionExtends RunTimeException; Thrown to indicate an attempt to use null where an object is required.
Describe Arithmetic ExceptionExtends RunTimeException; Thrown when exceptional arithmetic conditions occur such as dividing by zero
What is a Dynamic Array?These arrays can grow and shrink as needed.
What is a static array?an array of fixed length; Cannot be changed
Purpose of seqSearch() methodMethod from the UnorderedArrayList class; Takes in a DataElement and searches for the specified Element in the array and returns the location if it is found or -1 if it isnt found
makeCopy(ExtClock otherClock)?copy constructor Accepts ExtClock object parameter and copies the data members of the passed in ExtClock into the data members of this ExtClock
getCopy()?Data members of this ExtClock are copied into the corresponding data members of new ExtClock
insert(DataElement insertItem)searches list to make sure the item is not already in the list then if list isn't full it inserts the DataElement at the end of the list and increments list size
Describe a circular linked listIn this list the last node points to the first node and first node points to the last node
doubly linked list?nodes have 2 references; One reference to the next node and one reference to the previous node.
Recursion is?a function that calls itself; Must contain at least on base case. also has general case. and each recursive call must bring the problem closer to the base case.
What is a base case?It is a case where the recursion ends
What is a general case?This case is where the recursion actually happens.
What does the removeAt(int location) method do?removes the item located at specified location by moving last item to specified location then decrements list.
min()?compares elements in entire list to find the smallest element then returns smallest element
max()?compares elements in list to find the largest element then returns largest element
replace At(int location, DataElement element)replaces the element at specified location with the given DataElement
retrieveAt(int location)returns the element in the specified location.