




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、选择题 1: 1. What is the result when you compile and run the following code? 2. 2. public class Test 4. 3. 6. 4. public void method。 8. 5. 10. 6. for(int i = 0; i ” and“ ” . Which statement is true? .1010 0000 0000 0000 0000 0000 0000 0000 4 give 0000 1010 0000 0000 0000 0000 0000 0000 .1010 0000 0000
2、0000 0000 0000 0000 0000 4 give 1111 1010 0000 0000 0000 0000 0000 0000 C. 1010 0000 0000 0000 0000 0000 0000 0000 4 give 0000 0000 0000 0000 0000 B.public C. no modifer .1010 0000 0000 0000 0000 0000 0000 0000 4 give 1111 1010 0000 0000 0000 0000 0000 0000 9: A class design requires that a member v
3、ariable should be accessible only by same package, which modifer word should be used? Io-1 A. protected D.private 10: 1. public class OuterClass 2. private double d1 =1.0; 3. /insert code here 4. 5. You need to insert an inner class declaration at line3. Which two inner class declarati ons are 6. va
4、lid? A. class lnnerOne public static double methoda() retur n d1; r B. public class lnnerOne static double methoda() retur n d1; r C. private class lnnerOne double methoda() retur n d1; r D. static class lnnerOne protected double methoda() retur n d1; 11: 1. public class X 2. 2. public Object m() 4.
5、 3. Object o = new Float( 3.14F);/l ine 3 6. 4. Object oa = new Object 1;/li ne 4 8. 5. oa 0 = o;/line 5 10. 11.o=null;/line 6 12. 13. 14. return oa O;/line 7 15. 16. 16. 17. When is the Float object, created in line3,eligible for garbage collection? A.just after line 5. B. just after line 6 C. just
6、 after line 7(that is,as the method retur ns) .n ever in this method 12: Which statements about Java code security are not true? A.The bytecode verifier loads all classes needed for the execution of a program. .Executi ng code is performed by the run time in terpreter. C.At run time the bytecodes ar
7、e loaded, checked and run in an in terpreter. D. The class loader adds security by separating the namespaces for the classes of the local file system from those imported from n etwork sources. 13:使用JDBC可以做到的是 A.把二进制代码传送到任何关系数据库中 .把Java源代码传送到任何关系数据库中 C.把表单信息传送到任何关系数据库中 14: .很容易地把 SQL语句传送到任何关系数据库中 1.
8、Give the following code: 2. public class Example 3. public static void main(String args ) 4. int l= 0; 5. do 6. System.out.println(“ Doitifipr l is: ” +l); 7. while(-l 0) 8. System.out.println(“ Finish ” ); 9. 10. 11. Which well be output: A.Doing it for l is 3 B. Doing it for l is 1 C. Doing it for
9、 l is 2 .Doing it for l is 0 15: 1. What will happen when you attempt to compile and run the following code? 2. 2. int Output =10; 4. 3. boolean b1 = false; 6. 4. if(b1 = true) 12. 7. 14. 8. else 16. 9. 18. 10. System.out.pri ntln( Not equal! + Output); 20. 21. 22. 23. Choices: A.Compilati on error,
10、 attempt ing to perform bi nary comparis on on logical data type B. Compilation and output of We are equal 10. C. Compilation and output of Not equal! 20. D. Compilation and output of Not equal! 10. 16:设有变量说明语句int a=1,b=0; 则执行以下程序段的输岀结果为()。 switch (a) case 1: switch (b) case 0:prin tf(*0*);break; ca
11、se 1:pri ntf(*1*);break; case 2:printf(*2*);break; pri ntf(n); *0* r I B *0*2* C *0*1*2* D. 有语法错误 简答题 17: String是最基本的数据类型吗? 18:数组aN,存放了 1至N-1个数,其中某个数重复一次。写一个函数,找岀被重复的数字. 时间复杂度必须为 o ( N)函数原型:int do_dup(int a,int N) 19:用100元钱买100支笔,其中钢笔3元/支,圆珠笔 2元/支,铅笔0.5元/支, 问钢笔、圆珠笔和铅笔可以各买多少支? 20:如何现实servlet的单线程模式? 21:有一个整数 n,写一个函数f(n),返回0到n之间岀现的1的个数。比如f(13)=6,现在f(1)=1, 问下一个最大的f(n)=n的n是什么? 22:自己随意构造一个用户类(UserRecor
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 广东汉语自考试题及答案
- 理财从业考试题及答案
- 老师招考试题及答案
- 课件昆虫边框模板
- 客车直播考试题及答案
- 考研美术考试题及答案
- 康复语言考试题及答案
- 铌碳还原火法冶炼工特殊工艺考核试卷及答案
- 塑料压延工专项考核试卷及答案
- 经管考试题目及答案
- GB/T 5563-2013橡胶和塑料软管及软管组合件静液压试验方法
- GB/T 3600-2000肥料中氨态氮含量的测定甲醛法
- GB/T 24218.1-2009纺织品非织造布试验方法第1部分:单位面积质量的测定
- 电商客服培训考试
- 仿生科技课件
- 医师多点执业注册申请表
- 《边坡稳定性分析》课件
- 刮板输送机-课件
- 深信服防火墙技术方案
- 福建省福州市各县区乡镇行政村村庄村名明细及行政区划代码
- 临床医学晕厥课件
评论
0/150
提交评论