给出类的定义如下: 1. class Test{ void test(int i){ System.out.println("I am an int."); } void test(String s){ System.out.println("I am a string."); } public static void main(String args[]) { Test t=new Test(); char ch='y'; t.test(ch); } } 下列描述哪个正确?
A.
程序将不会编译,因为空的方法不能被覆盖。
B.
命令行t.test(ch); 将不会编译,因为没有对应的方法。
C.
代码将编译并输出以下结果: I am an int.
D.
代码将编译并输出以下结果: I am a string.
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
皮皮学刷刷变学霸
举一反三
【简答题】Why is the swine flu very erous to humans? A) Because it is fatal and has killed many people. B) Because it has spread to many countries. C) Because people know nothing about it. D) Because people...