Thursday, 24 May 2012

Convert String to Integer and vise versa

We easily convert String to Integer use of parseInt method and Integer to String use of  toString() method.

String To Integer
Syntax
   Integer.parseInt(Str);
Example :
  String name = "ram";
  Int  i = Integer.parseInt(name);


Integer To String
Syntax
   Integer.toString(intValue);
Example :
  int i = 10;
  String no = Integer.toString(i);


 that's all !!!

No comments:

Post a Comment