提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
转换成字符串
/* 来 自* N o w J a v a . c o m */ public class Main { 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)); } }