Simple Casting…1..

simple generic casting…hehe. kayak maen film aja ada casting…qkwkqwk


public class GenX<Y,P> {
 Y Y;
 P P;
 public GenX(Y A,P B){
 this.Y =  A;
 this.P =  B;
 }
 public Y getY(){
 return (Y) Y;
 }
 public P getP(){
 return (P) P;
 }
}


public class GenXPlay {
 public static void main(String[] args){
 GenX<String,Integer> mira = new GenX<String,Integer>("yaniar" , 22);
 String test = mira.getY();
 int test2 = mira.getP();
 System.out.print(test + " " + test2 + "\n");
 }
}