版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、文件Part I Single Selection (2 score per question)1.Which statement is true?( )public void test(int x) int odd = 1; if (odd) System.out.println(odd); else System.out.println(even);(A) odd will always be output.(B) even will always be output.(C) Compilation fails.(D) odd will be output for odd values o
2、f x, and even for even values.2.Which one is not valid IP address ?(A) 54 (B) 55 (C) 54 (D) 563.Select the one correct answer. The number of characters in an object of a class String is given by( )(A) The member variable called size.(B) The member variab
3、le called length(C) The method size() returns the number of characters.(D) The method length() returns the number of characters.4.Which code determines the int value data closer to, but not greater than, a double value b? ( )(A) Int data = (int) Math.floor(b);(B) Int data = (int) Math.abs(b);(C) Int
4、 data = (int) Math.ceil(b);(D) Int data = (int) Math.min(b);5.Linux file permission setting is presented by one string which length is 10,it can be divided into 4 parts from left to right, So what is the meaning of the part 3 ? Such as drwxrwxr-x = part1:d, part2:rwx, part3:rwx, part4:r-x(A) file ty
5、pe (B) permissions of file owner (C) permissions of file owners group (D) permissions of other users6.What will be the output of the program? ( )public class X public static void ma try tring args)badMethod(); System.out.print(A); catch (RuntimeException ex) System.out.print(B); catch (Exception ex1
6、) System.out.print(C); finally System.out.print(D);System.out.print(E);1文件public static void badMethod() throw new RuntimeException();(A) BD(B) BCD(C) B(D) BDE7.What is valid returnType for getData? ( )public class ReturnData getData(byte a, double z) return (a / z) * 10;(A) short(B) byte(C) int(D)
7、double8.What is the result? ( )public static void ma int index = 1;tring args)Boolean test = new Boolean3; boolean data = testindex;System.out.println(data);(A) true(B) false(C) null(D) NullPointerException9.What is the output? ( )public class Accessment implements Cloneable, Comparable int value =
8、1;public static void matring args) throws CloneNotSupportedException Accessment a = new Accessment(); Accessment b = change1(a); Accessment c = change2(b);System.out.println(a = b) + , +(a = c) + , +(b = c) + , +a.equals(c);static Accessment change2(Accessment b) throws CloneNotSupportedException Ac
9、cessment result = (Accessment) b.clone(); return result;static Accessment change1(Accessment a) a.setValue(2); return a;public void setValue(int value) this.value = value;public int compareTo(Accessment o) return this.value - o.value;public boolean equals(Object obj) return pareTo(Accessment
10、) obj) = 0;2文件(A) true,false,false,true(B) false,false,true,false(C) true,true,false,true(D) false,true,true,false10. Here is a network /24,the gateway is 。when server 0 want to communicate with network /24,which one is the right route setting:(A) route ad
11、d net gw netmask metric 1(B) route add net gw netmask 55 metric 1(C)route add net gw netmask metric 1(D) route add default netmask metric 1Part II Multiple Selection
12、(3 score per question)1. In OSI 7 layers model, which one will be included? (A) Physical Layer(B) Abstract Layer(C) Interface Layer (D) Transport Layer (E) Session Layer2. Linux is which kind of Operating System?(A) Multi User(B) Multi Tasking(C) Multi Process (D) All of the above(E) None of the abo
13、ve3.Run statements below, return false item(s) ( ) String a = hello;String b = hello;String c = new String(hello); char d = h,e,l,l,o;(A) System.out.println(a=b); (B) System.out.println(a=c);(C) System.out.println(a=d); (D)System.out.println(a.equals(d);4.The wrong statement(s) ( )(A) constructor in
14、 class cant ignore(B) constructor name must same with class name,but method name cant same with class name(C) constructor called when call object new (D) one class only has one constructor5.The method(s) in Thread class ( )(A) start()(B) run()(C) exit()(D) getPriority()6.Which of the following class
15、 belongs to the char type stream ( )(A) BufferedWriter3文件(B) FileInputStream(C) ObjectInputStream(D) InputStreamReader7.Java interface modifiers include ( )A privateB protectedC finalD abstract8.In Red hat which config file responsible for ip domain name resolution?(A) /etc/hosts(B) /etc/resolv.conf
16、(C) /etc/profile(D) /.bash_rc9.Linux command(s) for view net port used ( )(A) ping (B) netstat (C) lsof (D) ifconfig10. For a distributed computing system, the following ( ) indices cannot to satisfy together(A) consistency(B) availability(C) security(D) partition tolerancePart III Answer Question (
17、5 score per question)1. There is one HelloWorld.java (has main method) which imported some classes from lib.jar.How to compile the java file and execute the compiled class in command line? 编译:javac -Djava.ext.dirs=. HelloWorld.java 运行:java -Djava.ext.dirs=. HelloWorld2. Please fill in blank lines to
18、 finish these codes (you can write more than 1 line in each blank line if needed):./ get a loggerLogger logger = xxx;/ get one connection to databaseConnection conn = xxxx;/ create one transactionTransaction tx = xxxx;try logger.debug(“excute CRUD”); / do some CRUD works begin./ do some CRUD works e
19、nd mit(); catch (Exception e) tx rollback(); finally session.close(); 4文件.3. We has one command startEcho in linux, when execute this command it will print out hello world to console every 30 seconds. Now we want this command to be executed in background even when I logoff linux, and all the c
20、ontents it prints out should be stored in /tmp/startEcho.log.nohup hello world /tmp/startEcho.log 2&1&So how can I achieve this? (assume yourself have root account)4. There is a Java singleton example below.Please provide your codes to correct it for invoking the Singleton.get good performance.tance
21、() method in multi-thread environment withpublic class Singleton private static Singletontance = null;private Singleton() super();public static synchronized Singleton gettance() if (tance = null) tance = new Singleton();returntance;Part IV Programming (10 score per question)1. Write a multiple threa
22、d program to sum a big array. for example, use 5 threads to sum an integer array of 1 to 1000, one thread sum 200 numbers.public class MultiCalc private long totalResult = 5L;private Boolean isCompleted = null;public static void matring args) (new MultiCalc().startUp();private boolean isSuccessed()
23、for (int i = 0; i isCompleted.length; i+) if (!isCompletedi)return false;return true;private void startUp() 5文件int threadNum = 5;long numbers = 1000L;isCompleted = new BooleanthreadNum;for (int i = 1; i = threadNum; i+) isCompletedi - 1 = false;Thread t = new Thread(new CalcThread(i, numbers, thread
24、Num); t.start();synchronized (MultiCalc.this) try MultiCalc.this.wait(); catch (InterruptedException e) e.printStackTrace();System.out.println(计算结果为: + totalResult);classCalcThread implements Runnable private long start; private long end; private long result; private int threadIndex;public CalcThrea
25、d(int threadIndex, long numbers, int threadNum)long step = numbers / threadNum; this.threadIndex =threadIndex; start = (threadIndex - 1) * step + 1;if (threadIndex = threadNum) / 是否是最后一个线程end = numbers; else end = threadIndex * step;Overridepublic void run() for (long i = start; i = 60 for those les
26、son id = 3.SELECT *FROM STUDENT WHERE SCORE =60 AND LESSON =3Write a SQL to find out the average score for each student for his all lessons;2.SELECT NAME AVG(SCORE) FROM STUDENT GROUP BY NAME3.Write a SQL to find out the student whose score is larger than the average of each lesson and sort by LESSO
27、N (first) and NAME (second). (5 score)7文件SELECT LESSON NAME SCORE FROM (SELECT LESSON AVG(SCORE) A FROM STUDENT GROUP BY LESSON),STUDENT WHERE SCORE A;Part V English Writing (10 score)Scenario:1.2.Your English name is Kim.You are in a team name “GoodTeam”, and the team is doing some outsource projects for customer named “IT corpora
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 初中八年级道德与法治“榜样引领·德润青春”主题班会知识清单
- 初中八年级道德与法治《诚实守信:从伦理自觉到法治认同的进阶》议题式导学案
- 医疗器械生产监督管理办法培训考核试题附答案
- 2026年物流管理师实操技能考试卷及答案
- 焊接动火作业专项安全交底保证措施
- 海螺水泥中控操作员中级三培训考试试题及答案
- 2026年监理工程师之水利工程目标控制押题练习试题A卷含答案
- 高边坡危岩清除专项施工方案
- 排桩支护工程安全技术交底
- G1工业锅炉司炉证考试题库(答案)
- 2025年江苏省八年级地理生物会考考试试题及答案
- 2026年渝中区北碚区社区工作者招聘考试参考试题及答案解析
- 水利工程材料取样检测指南
- 守护网络安全护航青春成长-高二年级网络安全主题班会课件
- 雨课堂学堂在线学堂云《当代中国社会与文化:大湾区文化景观(暨南)》单元测试考核答案
- 银行外汇汇款课件
- 2025年福建农村信用社考试试题历年农信社笔试面试试题题库及答案
- 老年疼痛评估与综合管理方案
- 2025年10月自考00160审计学试题及答案含评分参考
- 2025年大学《土木水利与交通工程-土木水利与交通工程概论》考试参考题库及答案解析
- 肥胖患儿的饮食与营养
评论
0/150
提交评论