hi,
Wrapper classes are useful whenever it would be convinient to treat a primitive data as if it were an object. Wrapper classes provide methods to retrieve/extract the value from the wrapper object. they are the xxxValue() methods. where xxx can be byte, short, int, long, float or double.
I tried to run the following code to retrieve the long value with the shortValue() method and it worked. ! Can anyone explain please?
class getLongval{
public static void main(
String args[]){
Long val = new Long(123l);
System.out.println("long value is : "+val.byteValue());
}
}
The output i got is :
long value is : 123
Thanks,
Sunitha. S