Question: 1/The generic method public static void displayArray(E[] array) { for (E element : array) System.out.println(element); } can be passed a/ an array whose element type
1/The generic method
public static
can be passed
| a/ an array whose element type is Object | |
| b/ an array whose element type is E | |
| c/ an array whose element type is any superclass of Number | |
| d/ an array whose element type is Integer |
2/Constraining a type parameter in a generic class
| a/ causes programs to compile faster | |||||||||||||||||||||||||
| b/ was added to Java in version 1.3 of the language | |||||||||||||||||||||||||
| c/ can only be used when the generic class will be used as a superclass for other classes | |||||||||||||||||||||||||
| d/ restricts the types that can be used as type arguments 3/Constraining a type parameter in a generic class
|
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
