题目
关于以下application的说明,正确的是()
1.classStaticStuff
2.{
3.aticintx=10;
4.staticixt=5;}
5.publicstaticvoidmain(Stringargs[]){
6.System.out.println(“x=”+x);
7.}
8.static{x/=3;}
9.}
- A.4行与8行不能通过编译,因为缺少方法名和返回类型
- B.8行不能通过编译,因为只能有一个静态初始化器
- C.编译通过,执行结果为:x=5
- D.编译通过,执行结果为:x=3
提示:未搜索到的试题可在搜索页快速提交,您可在会员中心"提交的题"快速查看答案。
答案
查看答案
搜题