Given:
public class Test<T> {
private T t;
public T get () {
return t;
}
public void set (T t) {
this.t = t;
}
public static void main (String args [ ] ) {
Test<String> type = new Test<>();
Test type 1 = new Test (); //line n1
type.set("Java");
type1.set(100); //line n2
System.out.print(type.get() + " " + type1.get());
}
}
What is the result?
adnano1234
Highly Voted 4 years, 6 months agoDestroyer
Highly Voted 4 years, 7 months agoiSnover
Most Recent 5 months, 3 weeks ago