首页 试题广场 > 试题详情
单选题

在Java中,类Test的源代码如下所示,则该程序的编译运行结果是( )。
public class Test {
public int add(int a, int b){
return a+b;
}
public int length(int a,int b){
return add(a,b)*2; //第6行
}
public static void main(String[] args) {
Test test = new Test();
System.out.println("结果为:"+test.length(10,20)); //第10行
}
}

  • A.第6行出现编译错误,提示无法找到add方法
  • B.第10行出现编译错误,提示无法将int类型自动转换为String类型
  • C.输出:结果为:60
  • D.输出:结果为:null
提交并查看答案
下一题 上一题
Ke星伙伴们的回答/ 48个回答
关闭
关闭
QQ
交流群
邀请
好友
App
下载
意见
反馈
返回
顶部