Auto boxing followed by widening
//Auto boxing followed by widening is allowed.
//byte --to---> Byte ---to---> Object ------>allow
class Sc1
{
public static void m1(Object o)
{
System.out.println("Object");
}
public static void main(String a[])
{
byte b=5;
m1(b); //Object
}
}
0 comments:
Post a Comment