This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Changing int into object Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Changing int into object" Watch "Changing int into object" New topic
Author

Changing int into object

Manoj Paul
Ranch Hand

Joined: Jan 18, 2007
Posts: 109
Hi

How will i change int abc into an object?
Please advice
Anupam Sinha
Ranch Hand

Joined: Apr 13, 2003
Posts: 1088
Ty looking for it here.
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
int i1=100;
Integer I1 = new Integer(i1);
Now you have Integer object.


Thanks,


cmbhatt
Simon Baker
Ranch Hand

Joined: Sep 09, 2004
Posts: 57
Alternatively:
Arnav Velimala
Ranch Hand

Joined: Jun 04, 2007
Posts: 37
With J2SE 5.0 Autoboxing feature, you can simply code like this:
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Changing int into object
 
Similar Threads
Object to int array conversion
Question on deepToString()
Vector.addElement() not working
using rownum with union
Very Basic Question