




已阅读5页,还剩4页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
选择题 1:关于垃圾收集的哪些叙述是对的。 A.程序开发者必须自己创建一个线程进行内存释放的工作。 B.垃圾收集将检查并释放不再使用的内存。 C.垃圾收集允许程序开发者明确指定并立即释放该内存。 D.垃圾收集能够在期望的时间释放被java对象使用的内存。 2: 1. Strings=”ExampleString”;Whichoperationisnotlegal?String s=”Example String”;Which operation is not legal?A.int i=s.length(); B.s3=”x”; C.String short_s=s.trim(); D.String t=”root”+s; 3:What is written to the standard output given the following statement:System.out.println(4|7); Select the right answer: A.4 B.5 C.6 D.7 4:Which declares for native method in a java class corrected? A.public native void method() B.public native void method(); C.public native method(); D.public void native method(); 5: 1. Whathappenswhenyoutrytocompileandrunthefollowingprogram? 2. classMystery 3. Strings; 4. publicstaticvoidmain(Stringargs) 5. Mysterym=newMystery(); 6. m.go(); 7. 8. voidMystery() 9. s=”constructor”; 10. 11. voidgo() 12. System.out.println(s); 13. 14. What happens when you try to compile and run the following program?class MysteryString s;public static void main(String args)Mystery m=new Mystery();m.go();void Mystery()s=”constructor”;void go()System.out.println(s);A.this code compliles but throws an exception at runtime B.this code runs but nothing appears in the standard output C.this code runs and “constructor” in the standard output D.this code runs and writes ”null” in the standard output 6:public class Parent int change() class Child extends Parent Which methods can be added into class Child? A.public int change() B.abstract int chang() C.private int change() D.none 7: 1. Whatwillhappenwhenyouattempttocompileandrunthefollowingcode? 2. 3. publicclassStatic 4. 5. 6. 7. static8. 9. 10. 11. intx=5; 12. 13. 14. 15. staticintx,y; 16. 17. publicstaticvoidmain(Stringargs) 18. 19. 20. 21. x-; 22. 23. myMethod(); 24. 25. System.out.println(x+y+x); 26. 27. 28. 29. publicstaticvoidmyMethod() 30. 31. 32. 33. y=x+x; 34. 35. 36. 37. 38. 39. Choices:What will happen when you attempt to compile and run the following code? public class Staticstaticint x = 5; static int x,y;public static void main(String args) x-; myMethod(); System.out.println(x + y + +x); public static void myMethod()y = x+ + +x; Choices:A.prints : 2 B.prints : 3 C.prints : 7 D.prints : 8 8:A class design requires that a particular member variable must be accessible for direct access by any subclasses of this class. but otherwise not by classes which are not members of the same package. What should be done to achieve this? A.The variable should be marked public B.The variable should be marked private C.The variable should be marked protected D.The variable should have no special access modifier 9: 1. Givethefollowingcode: 2. publicclassExample 3. publicstaticvoidmain(Stringargs) 4. intl=0; 5. do 6. System.out.println(“Doingitforlis:”+l); 7. while(-l0) 8. System.out.println(“Finish”); 9. 10. 11. Whichwellbeoutput:Give the following code:public class Examplepublic static void main(String args )int l=0;doSystem.out.println(“Doing it for l is:”+l);while(-l0)System.out.println(“Finish”);Which well be output: A.Doing it for l is 3 B.Doing it for l is 1 C.Doing it for l is 2 D.Doing it for l is 0 10:假定a和b为int型变量,则执行下述语句组后,b的值为 a=1; b=10; do b-=a; a+; while (b-=0:methodB(); 10. 11. System.out.println(i); 12. 13. 14. 15. publicvoidmethodB() 16. 17. System.out.println(Thevaluemustnotbenegative); 18. 19. 20. 21. publicstaticvoidmain(Stringargs) 22. 23. AssertTesttest=newAssertTest(); 24. 25. test.methodA(-10); 26. 27. 28. 29. What will happen when you attempt to compile and run the following code?(Assume that the code is compiled and run with assertions enabled.)public class AssertTestpublic void methodA(int i)assert i = 0 : methodB();System.out.println(i);public void methodB() System.out.println(The value must not be negative);public static void main(String args)AssertTest test = new AssertTest();test.methodA(-10); A.it will print -10 B.it will result in AssertionError showing the message-“the value must not be negative”. C.the code will not compile. D.None of these. 18:Which is the main() method return of a application? A.String B.byte C.char D.void 19:设有变量说明语句int a=1,b=0; 则执行以下程序段的输出结果为( )。 switch (a) case 1: switch (b) case 0:printf(*0*);break; case 1:printf(*1*);break; case 2:printf(*2*);break; printf(n); A.*0* B.*0*2* C.*0*1*2* D.有语法错误 20: 1. Whatistheresultwhenyoucompileandrunthefollowingcode? 2. 3. publicclassTest 4. 5. 6. 7. publicvoidmethod() 8. 9. 10. 11. for(inti=0;i3;i+) 12. 13. 14. 15. System.out.print(i); 16. 17. 18. 19. System.out.print(i); 20. 21. 22. 23. 24. 25. Choices:What is the result when you compile and run the following code? public class Test public void method()for(int i = 0; i 3; i+) System.out.print(i); System.out.print(i); Choices:A.0122 B.0123 C.Compilation error D.None of these 简答题 21:已知abc+cba=1333,其中a,b,c均为一位数,编程求出满足条件的a,b,c所有组合。 22:How to use final to class,method and data? 23:介绍在Jsp中如何使用JavaBeans。 24:说明Jsp中errorPage的作用,应用范围。 25:请问你在什么情况下会在你的JAVA代码中使用可序列化?为什么放到HttpSession中的对象必须要是可序列化的? 26:试举例说明一个典型的垃圾回收算法? 27:Java中的异常处理机制的简单原理和应用。 28:EJB是基于哪些技术实现的?并说出SessionBean和EntityBean的区别,StatefulBean和StatelessBean的区别。 29:将一个链表逆序. 30:编写一个C语言函数(JAVA方法),要求输入一个url,输出该url是首页、目录页或者其他url 如下形式叫做首页: / / / / / 如下形式叫做目录页: /greenhouses-gas-global-green-house-warming/ .tw/
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 安徽省黄山市普通高中2026届高二化学第一学期期中综合测试试题含解析
- 新刑诉法试题及答案
- 健康银行面试题及答案
- 四川机械联考试题及答案
- 陕西中职试题及答案
- 深圳网约车考试试题技巧及答案
- 康复技术考试题及答案
- 胃癌手术试题及答案
- 学校119消防日活动总结
- 2020-2025年资产评估师之资产评估基础通关题库(附带答案)
- 2025年机关事业单位技能资格考试-文秘资料技师历年参考题库含答案解析(5套)
- 大学生法律普及知识讲座
- 2025年专科药剂学试题及答案
- 2025南方航空“梦起航”航务联合培养招聘笔试历年参考题库附带答案详解
- 苏州离婚协议书模板(2025版)
- 《电工》国家职业技能鉴定教学计划及大纲
- 零星维修工程(技术标)
- 篮球投篮教学的课件
- 园林绿化施工现场组织协调方案与措施
- 中专生招生管理办法细则
- 2025年度江苏行政执法资格考试模拟卷及答案(题型)
评论
0/150
提交评论