Predict the output of the following code:
public class Generic Demo<T>
{
private T T:
public void setValue(T t)
{
t = t;
System.out.println(T);
}
public static void main(String
args[])
{
Generic Demo< integer> gd1= new Generic Demo<>();
gd1.setValue(12);
}
}
output s:
a.0
b.12
c.compliation error
d.null
Answers
Answered by
0
Answer:
mark as brainlist
Explanation:
Predict the output of the following code:
public class Generic Demo<T>
{
private T T:
public void setValue(T t)
{
t = t;
System.out.println(T);
}
public static void main(String
args[])
{
Generic Demo< integer> gd1= new Generic Demo<>();
gd1.setValue(12);
}
}
output s:
a.0
b.12
c.compliation error
d.null
Similar questions