2010计算机等级考试二级(JAVA)笔试76(四)

时间:2011-08-18 07:49:25

微信搜索关注"91考试网"公众号,领30元,获取事业编教师公务员等考试资料40G
--------------

31、 public class Test{ public static void main(String args[]){ int a=2,b=4,c=6 Strint s=abc; System.out.print (a/b+s+c); } }

A.aac

B.242466

C.6ac6

D.24ac6

参考答案: C

----------------------------------------

32、 关于以下程序代码的说明正确的是______ (1) class HasStatic{ (2) private static int x=100: (3) public static void main (String args[]){ (4) HasStatic hs1=new Has Static(); (5) hs1.x + +; (6) Has Static hs2=new HasStatic(); (7) hs2.x + +; (8) hs1=new HasStatic(); (9) hs1.x + +: (10) System.out.println(x=+ x); (11) } (12) }

A.(5)行不能通过编译,因为引用了私有静态变量

B.(10)行不能通过编译,因为x是私有静态变量

C.程序通过编译,输出结果为:x=103

D.程序通过编译,输出结果为:x=100

参考答案: C


首页 上页 3 4 5 下页 尾页 4/5/5
微信搜索关注"91考试网"公众号,领30元,获取公务员事业编教师考试资料40G
【省市县地区导航】【考试题库导航】

电脑版  |  手机版  |  返回顶部