A)
->implicit conversion of a primitive type into object (wrapper) type is known as autoboxing.
Ex:
class autoboxing
{
static void x(Integer i)
{
System.out.println(i);
}
public static void main(String[] args)
{
Integer i= new Integer(10);
x(i);
x(10);//autoboxing - it is done with jdk1.5 anf 1.6. but ir is not in jdk 1.4
}
}
Output:
10
10
10
->autoboxing and auto unboxing is not work in jdk1.4, these are work from jdk1.5 on works.
Comments
Post a Comment