Results 1 to 2 of 2
Thread: Integer vs int
- 11-14-2007, 07:36 PM #1
Senior Member
- Join Date
- Nov 2007
- Posts
- 111
- Rep Power
- 0
- 11-14-2007, 09:13 PM #2
In j2se 1.5 autoboxing was introduced which automatically converts the int value "2" to an Integer object in this statement.
Before j2se 1.5 this would have caused a compile error.Java Code:Integer first_i = 2;
Integer is a wrapper class that wraps the primitive int value and makes it an Object for use where objects are required such as for use in the interface Comparable or for Collection interface implementations, eg, ArrayList.
For more see The Numbers Classes.
Similar Threads
-
Breaking down an integer
By Emily in forum New To JavaReplies: 1Last Post: 03-06-2008, 06:39 PM -
Integer Usage
By bluegreen7hi in forum New To JavaReplies: 11Last Post: 01-24-2008, 08:54 AM -
VeryLong Integer.. help
By hey in forum New To JavaReplies: 4Last Post: 12-14-2007, 09:48 PM -
Short/Integer
By mew in forum New To JavaReplies: 3Last Post: 12-06-2007, 09:28 PM -
Help with Integer in java
By susan in forum New To JavaReplies: 1Last Post: 07-14-2007, 05:25 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks