I was going through javaTpoint about wrapper class in java and it states that
"Change the value in Method: Java supports only call by value. So, if we pass a primitive value, it will not change the original value. But, if we convert the primitive value in an object, it will change the original value"
As first use of wrapper class in java, how can we demonstrate it? I've tried but it didn't worked
Heres my snippet
class demo {
void change(Integer a) {
a += 100;
System.out.println("Value in change: "+a);
}
public static void main (String [] a) {
Integer a = new Integer (10);
demo obj = new demo();
System.out.println("Value before change: "+a);
obj.change(a);
System.out.println("Value after change: "+a);
}
}