Question: HELP Generics are important to Java because they enable the creation of code that is a: Type-safe , b:Reusable, C: Reliable, D:all the above. Can

HELP

Generics are important to Java because they enable the creation of code that is

a: Type-safe , b:Reusable, C: Reliable, D:all the above.

Can a primitive type be used as a type argument?

a.

Yes, if the argument has more than one parameter

b.Yes, only primitive type can be used as a type argument

c. No, type argument must be object types

d.Yes, type argument does not have to be object types

Show how to declare a class called FlightSched that takes two generic parameters.

a.class FlightSched<>{T, V},

b.

class FlightSched(V, T) {

c.class FlightSched {

d.class FlightSched {

Can the wildcard argument be bounded?

a.Yes, a wild card must have a lower bound only

b.Yes, a wild card must have an upper bound only

c.No, a wild card argument cannot be bounded.

d.Yes, a wild card can have either an upper or lower bound

.Do type parameters exist at run time?

a.No, some type parameters are erased during runtime

b.No, all type parameters are erased during compliation, and appropriate casts are substituted

c.Yes, all type parameters exist at run time

d.No, all type parameters are erased during runtime, and appropriate casts are substituted
All methods in an abstract class must be decalred as abstract methods
true/false ?
Invoking a subclass-only method through a subclass variable is not allowed
true/false ?
If a superclass declares an abstract method, a subclass must implement that method.
true/false?
An object of a class that implements an interface may be thought of as an object of that interface type
true/false?
An annotation is syntactically based on a/an:

interface,

polymorphism

inheritance

none of the above ?

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!