Java examples for Language Basics:String
Converting to and from a String
public class Main { //from w ww .j a v a2 s .com public static void main (String[] args) { double pi; String strval; pi = Double.parseDouble("3.14"); System.out.println(strval = String.valueOf(pi)); System.out.println(Double.toString(pi)); } }