Solved

Consider the Class Class Value < T Extends Number >

Question 45

Multiple Choice

Consider the class
Class Value < T extends Number >
{
Private T v;
Public Value(T v1) {
V = v1;
}
Public void output() {
System.out.println(v) ;
}
}
The code
Value< Number > nV1 = new Value< Double >(34.5) ;


A) will cause a compiler error
B) will compile correctly,but cause an exception at run time
C) will compile and run correctly
D) None of the above

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents