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 void displayArray(E[] array) { for (E element : array) System.out.println(element); }

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

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

4/A generic class

a/can only extend a class that is also generic

b/can extend generic and non-generic classes

c/ can only extend a non generic class

d/ cannot extend any class

5/The class

public class Point3D extends Point { }

is an example of

a/a generic class extending the class Number

b/a generic class extending a non-generic class

c/ a generic class extending another generic class

d/ a non-generic class extending a generic class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!