public class GenericsType<T1,T2> {
private T1 x;
private T2 y;
@SuppressWarnings("unchecked")
public T1 get(){
return (T1) (x+"..."+y);
}
public void set(T1 x,T2 y){
this.x=x;
this.y=y;
System.out.println(x);
System.out.println(y);
}
@SuppressWarnings("unchecked")
public static void main(String[] args) {
GenericsType<Object,Integer> type = new GenericsType<>();
type.set("CSE",101);
@SuppressWarnings("rawtypes")
GenericsType type1 = new GenericsType();
type1.set("IT","CSE");
type1.set(10,3.5603245678);
}
}