my dog learned polymorphism*
The moose likes Beginning Java and the fly likes String to Int Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "String to Int" Watch "String to Int" New topic
Author

String to Int

Gemini Moses
Ranch Hand

Joined: Jan 04, 2001
Posts: 245
Can someone please help.
I want to convert 5 stored as String into a int. type.
How do I do it?
Rob Ross
Bartender

Joined: Jan 07, 2002
Posts: 2205
Look at the Integer.parseInt() method.

Rob


Rob
SCJP 1.4
Gemini Moses
Ranch Hand

Joined: Jan 04, 2001
Posts: 245
Thanks Rob.
you saved me just in time.
I hope this is the best way to do it.
Thanks,
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: String to Int