关于以下 代码段 的说明,正确的是() 1 . class StaticStuff 2 . { 3 . static int x = 10 ; 4 . static{x+=5 ; } 5 . public static void main ( String[] args ) 6 . { 7 . System.out.println(“x=”+x); 8 . } 9 . static{x/=3;} 10.}
A.
4行与9行不能通过编译,因为缺少方法名和返回类型
B.
9行不能通过编译,因为只能有一个静态初始化器
C.
编译通过,执行结果为:x=5
D.
编译通过,执行结果为:x=3
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
皮皮学刷刷变学霸
举一反三
【简答题】Which of the following statements is supported by the passage? [A] The college students have trouble separating good plants from wild grass [B] Craftsman’s experience is usually unscientific [C] The c...
【单选题】具有只读不能写,掉电后数据不会丢失的存储器是 2 具有可读可写功能,掉电后数据丢失的存储器是 。 A CPU B RAM C ROM D ALU 3 ROM是哪几个单词的缩写呢? A Read on write memory B Repeat only write C Read only medium D Read only mem...