Chapter 20 Review Flashcards
T or F
A generic and non-generic method can have the same method name
True. A generic method can be overloaded by a non-generic method of the same name.
All generic method declarations have a type-parameter section that immediately precedes the method name
False. The method type-parameter precedes the return type
A generic method can be declared only once in the type-parameter section but can appear more than once in the method’s parameter list.
True
Type-parameter names among different generic methods must be unique.
False.
The scope of a generic class’s type parameter is the entire class except its static members
True
What do generic methods and classes do?
Generics allow you to specify a single method or class to perform a function or related function on different types of data
A type-parameter is delimited by what characters?
<> angle brackets
A generic method’s ______ can be used to specify the method’s argument types, to specify the method’s return type and to declare variables within the method.
type parameter
If a generic class in instantiated and no type is specified. What default type is used?
Raw Type
What comes before the type-parameter in a generic class definition?
class name
The syntax _____________ specifies that the upper bound of a wildcard is type T?
? extends T
Upperbound
The upper bound class in a hierarchy defines the super class for which all classes within the domain are subs
Lowerbound
The lower bound class in a hierarchy defines the sub class for which all classes in the domain are a super-class.
Wildcard
A wildcard “?” is used in conjunction with the keyword ‘super’ or ‘extends’ to define an upper or lower bound domain.