大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。
Jetbrains全家桶1年46,售后保障稳定
网上巴巴的说了那么多,倒是给个结论啊.搜索半天,浪费一堆时间,不知道到底哪个说的对哪个说的错.
直接自己写着看吧.
float a1 = 2.42f;
float a2 = 2.13f;
float a3 = 2.89f;
float a4 = 2.99f;
float a5 = 2.35f;
float a6 = 35.67f;
float a7 = 9.8f;
float a8 = 1.2f;
float a9 = 5.5f;
float a10 = 0.7f;
float a11 = 0.9f;
float a12 = 0.01f;
System.out.println("原来的a1 = " + a1 + " 转化后的a1 = " + (int) a1);
System.out.println("原来的a2 = " + a2 + " 转化后的a2 = " + (int) a2);
System.out.println("原来的a3 = " + a3 + " 转化后的a3 = " + (int) a3);
System.out.println("原来的a4 = " + a4 + " 转化后的a4 = " + (int) a4);
System.out.println("原来的a5 = " + a5 + " 转化后的a5 = " + (int) a5);
System.out.println("原来的a6 = " + a6 + " 转化后的a6 = " + (int) a6);
System.out.println("原来的a7 = " + a7 + " 转化后的a7 = " + (int) a7);
System.out.println("原来的a8 = " + a8 + " 转化后的a8 = " + (int) a8);
System.out.println("原来的a9 = " + a9 + " 转化后的a9 = " + (int) a9);
System.out.println("原来的a10 = " + a10 + " 转化后的a10 = " + (int) a10);
System.out.println("原来的a11 = " + a11 + " 转化后的a11 = " + (int) a11);
System.out.println("原来的a12 = " + a12 + " 转化后的a12 = " + (int) a12);
结果如下图:
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/213946.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...