hi All,
How to convert String to number with sample example.
have a nice day.
hi All,
How to convert String to number with sample example.
have a nice day.
Use
Integer.parseInt("3");
It throws an exception if the string contains an invalid number.
Regards,
Sahil.
public static void main (String [] args) throws Exception {
String number = "30";
System.out.println(Integer.parseInt(number));
}
Please paste this in a java class file.
Regards,
Sahil.