20. Interfaces, including generic interfaces Flashcards
What is perhaps surprising about the way we say that a type argument of a generic class or interface or generic method, must implement a particular interface?
s
What are the three components of a type? In what way does a class have these things?
s
What typical trade-off is being shown when we compare this with the simplest way of searching a list?
s
What is the instance method that implements a total order in Java typically called? What parameters does it take and what result does it produce?
s
Which of the following, if any, are examples of multiple inheritance?
- An instance of class A is a B and has a C.
- An instance of class A is a B and also is a C, but B is not a C nor vice versa.
- An instance of class A is a B which in turn is a C.
- An instance of class A has a B and is a C
d
What is the main difference between an interface and a class? What can interfaces not contain?
s
Which of the three components of a type are provided by an interface, and which are provided by the classes that implement the interface?
s
What simple errors might we make, and what can we write to protect us from them?
s
If we do not supply type arguments for a generic interface when we use it, then what is it we are using?
s
How many other interfaces can an interface extend? How many classes can an interface extend?
s
How do we state that a class implements server interfaces?
s
When might we want to have a generic method rather than a generic class? How do we call a generic method - where do we write the type argument(s)? Do we actually have to write them anyway?
s
What do we mean by bound type parameter?
s
What is the purpose of Arrays class?
s
What must be true about the argument if it is an array of objects? (Arrays: sort())
s