Discussion :: Java.lang Class - Finding the output (Q.No.12)
|Div said: (Oct 20, 2011)|
|How it s 9? in System.out.println + means concatenation and not (+ ie add).|
|Suri said: (May 30, 2012)|
|Auto unboxing so they are automatticalyy convert into primitive.|
|Vikas Sahay said: (Apr 24, 2013)|
|But how can we add two different data type?|
|Tanaji Sen said: (Jul 25, 2015)|
|Someone please elaborate. I don't know the concept of wrapper class.|
|Bj Venu said: (Dec 25, 2015)|
|How we can add different data types?|
|Ejaz said: (Feb 12, 2016)|
|Automatic conversion will make all the variables in print statement to double and then add it to become 9.0.|
|Subha said: (Feb 8, 2019)|
|I think that,
x = int means it covert tat 3.0 as 3.
b = byte so that it takes byte as 0.
z = double means it takes the value as double which is 6.0
3 + 0 + 6.0 = 9.0.
Post your comments here:
Email : (optional)
» Your comments will be displayed only after manual approval.