收藏 分享(赏)

大数据基础技能试题及答案.doc

上传人:精品资料 文档编号:11038162 上传时间:2020-02-03 格式:DOC 页数:19 大小:128KB
下载 相关 举报
大数据基础技能试题及答案.doc_第1页
第1页 / 共19页
大数据基础技能试题及答案.doc_第2页
第2页 / 共19页
大数据基础技能试题及答案.doc_第3页
第3页 / 共19页
大数据基础技能试题及答案.doc_第4页
第4页 / 共19页
大数据基础技能试题及答案.doc_第5页
第5页 / 共19页
点击查看更多>>
资源描述

1、1Java 基础1. Which of the following will compile correctly?A) float f=10f;B) float f=10.1;C) float f=10.1f;D) byte b=10b;2. Which declarations of identifiers are legal A. $persons B. TwoUsers C. *point D. this E. _endline3. Which statement of assigning a long type variable to a hexadecimal value is co

2、rrect A. long number = 345L;B. long number = 0345;C. long number = 0345L;D. long number = 0x345L 4. Which of the following fragments might cause errors A. String s = “Gone with the wind“;String t = “ good “;String k = s + t;B. String s = “Gone with the wind“;String t;t = s3 + “one“;C. String s = “Go

3、ne with the wind“;String standard = s.toUpperCase();D. String s = “home directory“;String t = s - “directory“;5. Which are syntactically valid statement at/ point x class Person private int a;public int change(int m) return m; 2public class Teacher extends Person public int b;public static void main

4、(String arg)Person p = new Person();Teacher t = new Teacher();int i;/ point xA. i = m;B. i = b;C. i = p.a;D. i = p.change(30);E. i = t.b. 6. Which layout manager is used when the frame is resized the buttonss position in the Frame might be changed A. BorderLayoutB. FlowLayoutC. CardLayoutD. GridLayo

5、ut 7. Given the following code fragment:1) public void create() 2 Vector myVect;3 myVect = new Vector(); 4 Which of the following statements are true A. The declaration on line 2 does not allocate memory space for the variable myVect.B. The declaration on line 2 allocates memory space for a referenc

6、e to a Vector object.C. The statement on line 2 creates an object of class Vector.D. The statement on line 3 creates an object of class Vector.E. The statement on line 3 allocates memory space for an object of class Vector 8. Which of the following answer is correct to express the value 8 in octal n

7、umber A. 010B. 0x10C. 08D. 0x8 9. Which are not Java keywords A. TRUEB. sizeofC. const3D. superE. void 10. Which of the following statements are true A. The equals() method determines if reference values refer to the same object.B. The = operator determines if the contents and type of two separate o

8、bjects match.C. The equals() method returns true only when the contents of two objects match.D. The class File overrides equals() to return true if the contents and type of two separate objects match. 11. Which statements about inheritance are true A. In Java programming language only allows single

9、inheritance. B. In Java programming language allows a class to implement only one interface.C. In Java programming language a class cannot extend a class and implement a interface together.D. In Java programming language single inheritance makes code more reliable. 12. 1) class Person 2 public void

10、printValue(int i, int j) /*/ 3 public void printValue(int i)/*.*/ 4 5) public class Teacher extends Person 6 public void printValue() /*.*/ 7 public void printValue(int i) /*.*/8 public static void main(String args)9 Person t = new Teacher();10 t.printValue(10);11 12 Which method will the statement

11、on line 10 call A. on line 2B. on line 3C. on line 6D. on line 7 13. Which are not Java primitive types A. shortB. BooleanC. unitD. float 414、 The method resume() is responsible for resuming which threads execution A. The thread which is stopped by calling method stop()B. The thread which is stopped

12、 by calling method sleep()C. The thread which is stopped by calling method wait()D. The thread which is stopped by calling method suspend()15. Which of the following range of int is correct A. -27 27-1 B. 0 232-1 C. -215 215-1 D. -231 231-1 16. Which keyword should be used to enable interaction with

13、 the lock of an object The flag allows exclusive access to that object. A. transientB. synchronizedC. serializeD. static 17. Which is the return type of the method main() A. intB. voidC. booleanD. static 18. Given the following code:if (x0) System.out.println(“first“); else if (x-3) System.out.print

14、ln(“second“); else System.out.println(“third“); Which range of x value would print the string “second“ A. x 0B. x -3C. x -3 19、 Which of the following answer is correct to express the value 10 in hexadecimal number A. 0xAB. 0x16C. 0AD. 01620. Which statements about the garbage collection are true A.

15、 The program developer must create a thread to be responsible for free the memory.5B. The garbage collection will check for and free memory no longer needed.C. The garbage collection allow the program developer to explicity and immediately free the memory.D. The garbage collection can free the memor

16、y used java object at expect time. 21、 Given the following code:1) public class Test 2 int m, n;3 public Test() 4 public Test(int a) m=a; 5 public static void main(String arg) 6 Test t1,t2;7 int j,k;8 j=0; k=0;9 t1=new Test();10 t2=new Test(j,k);11 12 Which line would cause one error during compilat

17、ion A. line 3B. line 5C. line 6D. line 1022、 Given the uncompleted code of a class:class Person String name, department;int age;public Person(String n) name = n; public Person(String n, int a) name = n; age = a; public Person(String n, String d, int a) / doing the same as two arguments version of co

18、nstructor / including assignment name=n,age=adepartment = d;Which expression can be added at the “doing the same as.“ part of the constructor A. Person(n,a);B. this(Person(n,a);C. this(n,a);D. this(name,age).623、 Which of the following statements about variables and their scopes are true A. Instance

19、 variables are member variables of a class.B. Instance variables are declared with the static keyword.C. Local variables defined inside a method are created when the method is executed.D. Local variables must be initialized before they are used.24、 public void test() try oneMethod();System.out.print

20、ln(“condition 1“); catch (ArrayIndexOutOfBoundsException e) System.out.println(“condition 2“); catch(Exception e) System.out.println(“condition 3“); finally System.out.println(“finally“); Which will display if oneMethod run normally A. condition 1B. condition 2C. condition 3D. finally25、 Given the f

21、ollowing code:public class Test void printValue(int m)do System.out.println(“The value is“+m);while( -m 10 )public static void main(String arg) int i=10;Test t= new Test();t.printValue(i);Which will be output A. The value is 8 B. The value is 9C. The value is 10D. The value is 11726、 Which of the fo

22、llowing statements about declaration are true A. Declaration of primitive types such as boolean, byte and so on does not allocate memory space for the variable.B. Declaration of primitive types such as boolean, byte and so on allocates memory space for the variable.C. Declaration of nonprimitive typ

23、es such as String, Vector and so on does not allocate memory space for the object.D. Declaration of nonprimitive types such as String, Vector ans so on allocates memory space for the object.27、 In the Java API documentation which sections are included in a class document A. The description of the cl

24、ass and its purposeB. A list of methods in its super classC. A list of member variableD. The class hierarchy28、 Given the following code:1) public void modify() 2) int i, j, k;3) i = 100;4) while ( i 0 ) 5) j = i * 2;6) System.out.println (“ The value of j is “ + j );7) k = k + 1;8) i-;9) 10 Which l

25、ine might cause an error during compilation A. line 4B. line 6C. line 7D. line 829、 Which of the following statements about variables and scope are true A. Local variables defined inside a method are destroyed when the method is exited.B. Local variables are also called automatic variables.C. Variab

26、les defined outside a method are created when the object is constructed.D. A method parameter variable continues to exist for as long as the object is needed in which the method is defined.830、 A class design requires that a member variable cannot be accessible directly outside the class. Which modi

27、fier should be used to obtain the access control A. publicB. no modifierC. protectedD. private31、 Given the following code fragment:1) String str = null;2) if (str != null) 4 5) else if (str != null) B ; C ; D A9在 vi 编辑器中的命令模式下,重复上一次对编辑的文本进行的操作,可使用 _ 命令。A 上箭头 B 下箭头 C ; D ;10用命令 ls -al 显示出文件 ff 的描述如下

28、所示,由此可知文件 ff 的类型为 _ 。-rwxr-xr- 1 root root 599 Cec 10 17:12 ffA 普通文件 B 硬链接 C 目录 D 符号链接11删除文件命令为:_ 。A mkdir B rmdir C mv D rm12对文件进行归档的命令为_ 。A dd B cpio C gzip D tar13改变文件所有者的命令为 _ 。A chmod B touch C chown D cat14在给定文件中查找与设定条件相符字符串的命令为: _ 。A grep B gzip C find D sort15建立一个新文件可以使用的命令为 _ 。A chmod B mor

29、e C cp D touch16 在下列命令中,不能显示文本文件内容的命令是:_ 。 A more B less C tail D join17文件权限读、写、执行的三种标志符号依次是 _ 。A rwx B xrw C rdx D srw18在 Shell 脚本中,用来读取文件内各个域的内容并将其赋值给 Shell 变量的命令是 _ 。A fold B join C tr D read1619 crontab 文件由六个域组成,每个域之间用空格分割,其排列如下: _ 。A MIN HOUR DAY MONTH YEAR COMMANDB MIN HOUR DAY MONTH DAYOFWEEK

30、 COMMANDC COMMAND HOUR DAY MONTH DAYOFWEEK D COMMAND YEAR MONTH DAY HOUR MIN20用 ftp 进行文件传输时,有两种模式:_ 。A Word 和 binary B .txt 和 Word Document C ASCII 和 binary D ASCII 和 Rich Text Format21退出交互模式的 shell,应键入 _ 。A ; B q C exit D quit数据库 sql 简答题1. 用一条 SQL 查询出每门课目的平均值Table1:name subject mark 张三 语文 81张三 数学 7

31、5张三 英语 87李四 语文 76李四 数学 90李四 英语 78王五 语文 81王五 数学 100王五 英语 902. 表 student1 如下:自动编号 学号 姓名 课程编号 课程名称 分数1 2005001 张三 0001 数学 692 2005002 李四 0001 数学 893 2005001 张三 0001 数学 69用 1 条 SQL 删除相同的学生冗余信息(自动编号不同可忽略)3. 一个叫 player 的表如下Name张三17李四王五赵六请用一条 SQL 语句显示出所有选手一对一比赛有可能的组合4. 如何把这个名为 aaa 的表 year month amount1991

32、1 1.11991 2 1.21991 3 1.31991 4 1.41992 1 2.11992 2 2.21992 3 2.31992 4 2.4查成这样一个结果year m1 m2 m3 m41991 1.1 1.2 1.3 1.41992 2.1 2.2 2.3 2.4 逻辑简答题1、 假设有一个池塘,里面有无穷多的水。现有 2 个空水壶,容积分别为 5 升和 6 升。问题是如何只用这 2 个水壶从池塘里取得 3 升的水。2、 有一个大西瓜,用水果刀平整地切, 总共切 9 刀, 最多能切成多少份,最少能切成多少份 ?3、 1 元钱一瓶汽水,喝完后两个空瓶换一瓶汽水,问:你有 20 元钱

33、,最多可以喝到几瓶汽水?4、 一个岔路口分别通向诚实国和说谎国。来了两个人,已知一个是诚实国的,另一个是说谎国的。诚实国永远说实话,说谎国永远说谎话。现在你要去说谎国,但不知道应该走哪条路,需要问这两个人。请问应该怎么问?5、 有三顶红帽子和两顶白帽子。将其中的三顶帽子分别戴在 A、B、C 三人头上。这三人每人都只能看见其他两人头上的帽子,但看不见自己头上戴的帽子,并且也不知道剩余的两顶帽子的颜色。问 A:”你戴的是什么颜色的帽子?” A 回答说:”不知道。 ” 接着,又以同样的问题问B。B 想了想之后,也回答说:”不知道。 ” 最后问 C。C 回答说:”我知道我戴的帽子是什么颜色了。 ” 当

34、然,C 是在听了 A、B 的回答之后而作出回答的。试问:C 戴的是什么颜色的帽子?18Java 基础java 基础1 2 3 4 5 6 7 8 9 10A,C A,B,E D B,D D,E B A,D,E A A,B A,D11 12 13 14 15 16 17 18 19 20A,D D B,C D D B B D A B21 22 23 24 25 26 27 28 29 30D C A,C,D A,D C A,D A,C,D C A,B,C D31 32 33 34 35 36 37 38 39 40C B,C,D A B,C B,D B D C A,C,D A,C,D41 42

35、43 44 45 46 47 48 49 50A,D,E A,B E B,C D A,B C B C BD51 52 53B D A1 2 3 4 5 6 7 8 9 10C D C B D D D B C A11 12 13 14 15 16 17 18 19 20D D C A D D A D B C21C19Linux 基础数据库 sql 答案(答案有多种,仅参考)1.select subject,sum(mark)/3 as 平均值 from table1 where mark 80 group by subject;2.delete student1 where 自动编号 not i

36、n(select min( 自动编号) from tablename group by 学号, 姓名 , 课程编号 , 课程名称, 分数)3.select a.name, b.name from player a, player b where a.name b.name4.select year, (select amount from aaa m where month=1 and m.year=aaa.year) as m1,(select amount from aaa m where month=2 and m.year=aaa.year) as m2,(select amount

37、from aaa m where month=3 and m.year=aaa.year) as m3,(select amount from aaa m where month=4 and m.year=aaa.year) as m4from aaa group by year逻辑题1、 由满 6 向空 5 倒,剩 1 升,把这 1 升倒 5 里,然后 6 剩满,倒 5 里面,由于 5 里面有1 升水,因此 6 只能向 5 倒 4 升水,然后将 6 剩余的 2 升,倒入空的 5 里面,再灌满 6向 5 里倒 3 升,剩余 3 升。2、 最少 10 块;最多 29 块,即 512 块。3、 404、 我要到你的国家去,请问怎么走?然后走向路人所指方向的相反方向.5、 白色

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 企业管理 > 管理学资料

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报