Can you please explain how & what exactly is happening in option 1 of this answer.
Option 1:
To my understanding, reference variable t has been assigned an object holding value of 106.Object t = new Integer(106);
int k = ((Integer) t).intValue()/10;
System.out.println(k);
Then integer variable k is assigned a value of : value acquired by variable t which is casted into integer (i.e. 106), then method intValue() is also returning the same value(i.e. 106) and it is then divided by 10.
And why we need intValue method here. Though the code is running fine without even using intValue() method.