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< Double > 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:
Verified
Q37: The process of erasure
A) helps generic code
Q38: In the notation < T super Number
Q39: The class
Public class Point3D< T extends Number
Q40: Which of the following generic type notations
Q41: The clause
Catch(Exception< T > e){
}
A) can be
Q43: A static field of a generic class
A)
Q44: The code
Public class MyClass< T >
{
Public MyClass(){
T
Q45: Consider the class
Class Value < T extends
Q46: The code
ArrayList< String > [ ] a
Q47: A static method of a generic class
A)
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents