解决方案 »

  1.   

    int  的结果是整数,  float  是带小数的,结果是float类型的
      

  2.   

    是float类型
    可以用以下程序测试一下public class Test {
    public void test(float f) {
    System.out.println("float");
    } public void test(double d) {
    System.out.println("double");
    } public void test(int i) {
    System.out.println("int");
    } public static void main(String[] args) {
    Test t = new Test();
    int i = 10;
    float f = 10f;
    t.test(f * i);
    }
    }
    输出结果为float
      

  3.   

    float类型,java自动类型转换会将int类型向上转换为float类型,可以看下面的代码,如果是double类型的话则需要强制类型转换:public static void main(String[] args) {
    int i = 5;
    float f =3.5f;
    double b;
    float f1;
    f1 = i * f;//若int和float的运算结果为double,则需要像下面那样强制类型转换
    b = i * f;
    f1 = (float) b;
    }
      

  4.   

    java 中的自动转换 从位数低的类型向位数高的类型转换。是FLOAT类型的!你自己可以写个列子试试!