移动端

  • 题王微信公众号

    题王微信公众号

    微信搜“题王网”真题密题、最新资讯、考试攻略、轻松拿下考试

单选题

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?()

发布日期:2020-04-10

Consider the following class:     class Test(int i...
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.

标签: class class test int void

题王网让考试变得更简单

扫码关注题王,更多免费功能准备上线!

此试题出现在

CMS专题

CMS专题

去刷题
热门试题热门资讯 相关试题

暂无相关推荐~