1/6
lord pray for me
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
interfaces are different from classes because
it cannot be instantiated (i.e., can’t be object/dynamic types)
cannot extend classes
can hold private and public members (not different than a class)
constructors are/can…
can have a pre and post condition
are obligated to satisfy the representation invariant, if there is one
code is running, a checked exception occurs. what must be true?
it either occurred in a try block or in a method that throws it
some catch block executes, unless main() declares that it throws an exception of a type matching it
if a catch block executes, then the exception in the catch matches the thrown exception’s type
working with JCF’s Map<K, V> can be tricky because?
can’t iterate through a Map directly
using views backed up by the Map can lead to aliasing errors
it doesn’t offer a method with OSU’s Map’s removeAny’s behavior
when using java iterators on a set (OSU or JCF)
adding things to the set while you iterate is unsafe
can safely copy aliases to the elements if they’re immutable
using a for-each loop is a shorthand for a particular use of an Iterator object
design by contract requires
the client to be certain a method’s preconditions are satisfied
heap arrays…
use a way of storing data that implicitly represents a complete binary tree
can be used to sort data
can hold data in partially-sorted form until the smallest item is needed