File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Changing int into object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Changing int into object" Watch "Changing int into object" New topic

Changing int into object

Manoj Paul
Ranch Hand

Joined: Jan 18, 2007
Posts: 112

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

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

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


Simon Baker
Ranch Hand

Joined: Sep 09, 2004
Posts: 57
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:
subject: Changing int into object
It's not a secret anymore!