Content deleted Content added
add {{seealso|Object (computer science)}} |
fmt |
||
Line 1:
{{Article issues|expert=Computer science|
{{Generalize|date=October 2009}}<!-- only talks of Java; there are complaints on the talk page about this -->
Line 31:
</source>
Compilers prior to 5.0 would not accept the last line. <code>Integer</code>s are reference objects, on the surface no different from <code>List</code>, <code>Object</code>, and so forth; mathematical operators such as <code>+</code> were not meaningfully defined for references. As of J2SE 5.0, the <code>Integer</code>s <code>i</code> and <code>j</code> are unboxed into <code>int</code>s, the two are added, and then the sum is autoboxed into a new <code>Integer</code>.
===Unboxing===
Line 53:
Console.Writeline(j); //outputs "42"
</source>
==References==
{{reflist}}
{{DEFAULTSORT:Object Type (Object-Oriented Programming)}}
|