试题详情
- 单项选择题 Consider the following class: class Test(int i) { 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); } } Which of the statements below is true?()
A、 Line 5 will not compile, because void methods cannot be overridden.
B、 Line 12 will not compile, because there is no version of test() that rakes a charargument.
C、 The code will compile but will throw an exception at line 12.
D、 The code will compile and produce the following output: I am an int.
E、 The code will compile and produce the following output: I am a String.
- D
关注下方微信公众号,在线模考后查看
热门试题
- What is th
- class One&ensp
- Which willQ
- 下列关于JDK、JRE和JVM的描述。哪
- 抽象方法可以包含在任何类中()̳
- 在JAVA程序中,类是由定义和主体构成的
- 已知: 下面哪些代码是对构造函数的重载
- A web comp
- 卡片式分局所管理的是面板。一个采用卡片式
- 定义类: &en
- Given classes defin
- 已知: 要想打印出in.txt的全部内
- Company.com ha
- What is th
- 输入某年某月某日,判断这一天是这一年的第
- What is th
- 字符串的append函数可以添加多种内
- 下面有关SPRING的事务传播特性,说法
- 将GUI窗口中的组件按照从左到右如打字式
- 我们用一个等臂天平来称物体的质量,如果我