class box<t>
{
t e;
public box(t t1)
{
this.e=t1;
}
public t show()
{
return e;
}
}
public class g1
{
public static void main(String s[])
{
box <Integer> i=new box<Integer>(42);
System.out.println("integer value="+i.show());
box<String>i2=new box<String>("hithin");
System.out.println("string value="+i2.show());
}
}
{
t e;
public box(t t1)
{
this.e=t1;
}
public t show()
{
return e;
}
}
public class g1
{
public static void main(String s[])
{
box <Integer> i=new box<Integer>(42);
System.out.println("integer value="+i.show());
box<String>i2=new box<String>("hithin");
System.out.println("string value="+i2.show());
}
}
No comments:
Post a Comment