Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Converstion of String To int

 
Aru Ven
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Can someone help me with how to convert an String to a int....
I am writing a piece of code & I am having some problem if I used the intValue() function. Help.
Thanks,
Aruna
 
ali farid
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
you can use this:
String str="123";
int i=Integer.parseInt(str);
 
Aru Ven
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thx Ali,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic