posted 19 years ago
Hi,
Welcome to JavaRanch!
There are static methods in the Integer, Long, Double, and Float classes that can convert a String to an int, long, double, or float, respectively. For example,
Be aware that all these methods can throw NumberFormatExceptions, and a robust program will catch this exception and report that the String didn't contain a valid number.