Exam 2 Review Flashcards
(25 cards)
Why do we use the Software Development Life Cycle?
It allows for more efficiency in the coding process
Difference between functional and nun-functional requirements
Functional: deals with inputs/outputs/behaviors
Nonfunctional: everything else (language… whatever)
The sooner you catch a mistake, the cheaper it is. (T/F)
True
Polymorphism
a feature of java that allows a method to be selected at runtime… enables inheritances/interfaces
How do you write a comparable interface? What is required?
the class must ‘implements Comparable’
there must be a x.compareTo(y) method
How to write a comparator interface?
implements Comparator
includes a compare(x,y) method
Substitutability Principle
child can be substituted for anywhere a parent can go
Stacks order?
LIFO
Queues order?
FIFO
What is necessary for a binary search?
A sorted array!!!!
Generally accepted phases of the Software Development Life Cycle..
Requirements, Design, Implementation and Testing, Maintenance
Can interfaces be instantiated?
No
Can an interface implement a method? If so, how?
Yes, using the default keyword
Interfaces have a constructor (T/F)
False
Classes implement an interface (T/F)
True
Classes can only have one parent class but can implement many interfaces (t/f)
True
Comparable interface defines the natural order for a class…(t/f)
True
Comparator interface defines a total ordering based on what ur looking for (t/f)
True
Abstract classes can be instantiated (t/f)
False
Can abstract classes provide an implementation for methods?
Yes
What are benefits of an abstract class?
It’s very easy to define variables/methods/constructors for classes to use this abstract classes.
Pop() vs peek()
Pop() = removes and returns the top
Peek() only looks at the top
Errors and Exceptions inherit from
Throwable
Exceptions are short for
Exceptional Events