源程序: public class Test{ public static void main(String args[]){ float num = 3.0f; System.out.println("两个小数相乘的结果:"+num*num); } } 运行结果: