易搜题 > 资格证大类 > 计算机编程 > 问题详情
问题详情

1. public class A {  2.  3. private int counter = 0;  4.  5. public static int getInstanceCount() {  6. return counter;  7. }  8.  9. public A() {  10. counter++;  11. }  12.  13. }  Given this code from Class B:  25.A a1 =new A();  26. A a2 =new A();  27. A a3 =new A();  28. System.out.printIn(A.getInstanceCount() ); What is the result?() 

A、 Compilation of class A fails.

B、 Line 28 prints the value 3 to System.out.

C、 Line 28 prints the value 1 to System.out.

D、 A runtime error occurs when line 25 executes.

E、 Compilation fails because of an error on line 28.

未找到的试题在搜索页框底部可快速提交,在会员中心"提交的题"查看可解决状态。 收藏该题
查看答案

相关问题推荐

  • 在项目评估中,评价项目是否符合项目的规划问题属于()的内容。

    A、项目建设必要性评估

    B、项目建设条件评估

    C、项目技术评估

    D、项目财务效益评估

  • Which operations require undo data()

    A

    Committing a transaction

    B

    Flashing back a transaction

    C

    Recovering a failed transaction

    D

    Running a read-consistent query

    E

    Changing a tablespace status from READ ONLY to READ WRITE

  • 风险管理计划是()的主要组成部分。

    A、项目计划

    B、沟通计划

    C、采购计划

    D、质量管理计划

  • 写出五种安全机制。

  • 渐变型多模光纤

联系客服 会员中心
TOP