This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes How to convert from String to Integer? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "How to convert from String to Integer?" Watch "How to convert from String to Integer?" New topic
Author

How to convert from String to Integer?

qionghua yang
Ranch Hand

Joined: Oct 31, 2000
Posts: 68
Hi there,
I have this String "12" and I would like to have an Integer. Is there any easy way to cast or convert it to an Integer? Thanks!
qionghua
Peter Tran
Bartender

Joined: Jan 02, 2001
Posts: 783
Use Integer.parseInt("12").
-Peter
qionghua yang
Ranch Hand

Joined: Oct 31, 2000
Posts: 68
Hi Peter,
It works. Thanks a lot!
qionghua
 
 
subject: How to convert from String to Integer?
 
Similar Threads
Convert string to integer without any API ?
String to Object conversion & vice-versa
integer to string
Integer Conversion
Convert byte to its hex format?