云南云电同方科技有限公司

云南云电同方科技有限公司

ID:38733176

大小:263.00 KB

页数:9页

时间:2019-06-18

云南云电同方科技有限公司_第1页
云南云电同方科技有限公司_第2页
云南云电同方科技有限公司_第3页
云南云电同方科技有限公司_第4页
云南云电同方科技有限公司_第5页
资源描述:

《云南云电同方科技有限公司》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、选择题1:1.What will be the result of executing the following code?   2.  3.public static void main(String args[])  4.{  5.   char digit = 'a';  6.   for (int i = 0; i < 10; i++)  7.   {  8.     switch (digit)  9.     {  10.       case 'x' :  11.       {  12.         int j = 0;  13.         Sy

2、stem.out.println(j);  14.       }  15.       default :  16.       {  17.       int j = 100;  18.System.out.println(j);  19.       }  20.     }  21.  }  22.  int i = j;  23.  System.out.println(i);  24.}   25.  26.Choices:  Whatwillbetheresultofexecutingthefollowingcode?publicstaticvoidmain

3、(Stringargs[]){chardigit='a';for(inti=0;i<10;i++){switch(digit){case'x':{intj=0;System.out.println(j);}default:{intj=100;System.out.println(j);}}}inti=j;System.out.println(i);}Choices:A.100willbeprinted11times.B.Thecodewillnotcompilebecausethevariableicannotbedeclaredtwicewithinthemain()me

4、thod.C.Thecodewillnotcompilebecausethevariablejcannotbedeclaredtwicewithintheswitchstatement.D.Noneofthese.2:1.Give the code fragment:  2.if(x>4){  1.System.out.println(“Test 1”);}  2.else if (x>9){  3.System.out.println(“Test 2”);}  4.else {  5.System.out.println(“Test 3”);}  6.Which rang

5、e of value x would produce of output “Test 2”?   Givethecodefragment:if(x>4){System.out.println(“Test1”);}elseif(x>9){System.out.println(“Test2”);}else{System.out.println(“Test3”);}Whichrangeofvaluexwouldproduceofoutput“Test2”?A.x<4B.x>4C.x>9D.None3:关于垃圾收集的哪些叙述是对的。A.程序开发者必须自己创建一个线程进行内存释放的工

6、作。B.垃圾收集将检查并释放不再使用的内存。C.垃圾收集允许程序开发者明确指定并立即释放该内存。D.垃圾收集能够在期望的时间释放被java对象使用的内存。4:1.Give the following method:  2. public void method( ){  3. String a,b;  4. a=new String(“hello world”);  5. b=new String(“game over”);  6. System.out.println(a+b+”ok”);  7. a=null;  8. a=b;  9. System.out.print

7、ln(a);  10. }   11.In the absence of compiler optimization, which is the earliest point the object a refered is definitely elibile to be garbage collection.  Givethefollowingmethod:publicvoidmethod(){Stringa,b;a=newString(“helloworld”);b=newString(“gameover”);

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。