首页 > 试题广场 >

请说出E类中【代码1】和【代码2】的输出结果。 class

[问答题]
请说出E类中【代码1】和【代码2】的输出结果。
class A{
    double f(int x,double y){
        return x+y;
    }
    int f(int x,int y){
        return x*y;
    }
}
public class E{
    public static void main(String args[ ]){
        A a =new A();
        System.out.println(a.f(10,10));  //【代码1】
        System.out.println(a.f(10,10.0)); //【代码2】
    }
}

100 20.0
发表于 2021-04-27 01:18:53 回复(0)
没有结果  
发表于 2020-12-20 20:25:17 回复(0)