集册 Java实例教程 将Float对象转换为String对象

将Float对象转换为String对象

欢马劈雪     最近更新时间:2020-01-02 10:19:05

456
提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
将Float对象转换为String对象


 

public class Main {
/*
时 代 J a v a - N o w J a v a . c o m 提供
*/

 

  public static void main(String[] args) {

 

    Float fObj = new Float(10.25);

    String str = fObj.toString();

    System.out.println("Float converted to String as " + str);

  }

}