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

上传人:wux****ua 文档编号:9320509 上传时间:2020-04-04 格式:DOC 页数:19 大小:128KB
返回 下载 相关 举报
大数据基础技能试题及答案.doc_第1页
第1页 / 共19页
大数据基础技能试题及答案.doc_第2页
第2页 / 共19页
大数据基础技能试题及答案.doc_第3页
第3页 / 共19页
点击查看更多>>
资源描述
Java基础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 correct 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 = Gone 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; public class Teacher extends Person public int b;public static void main(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. GridLayout 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 reference 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 number A. 010B. 0x10C. 08D. 0x8 9. Which are not Java keywords A. TRUEB. sizeofC. constD. 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 objects 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 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 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 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 14、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 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 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.println(second); else System.out.println(third); Which range of x value would print the string second A. x 0B. x -3C. x = -3D. x -3 19、Which of the following answer is correct to express the value 10 in hexadecimal number A. 0xAB. 0x16C. 0AD. 016 20. Which statements about the garbage collection are true A. The program developer must create a thread to be responsible for free the memory.B. 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 memory 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 compilation A. line 3B. line 5C. line 6D. line 10 22、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 constructor / 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).23、Which of the following statements about variables and their scopes are true A. Instance 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.println(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 following 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 1126、Which of the following 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 types 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 class 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 line 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. Variables 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.30、A class design requires that a member variable cannot be accessible directly outside the class. Which modifier should be used to obtain the access control A. publicB. no modifierC. protectedD. private 31、Given the following code fragment:1) String str = null;2) if (str != null) & (str.length() 10) 3 System.out.println(more than 10);4 5) else if (str != null) & (str.length() 5) 6 System.out.println(less than 5);7 8) else System.out.println(end); Which line will cause error A. line 1B. line 2C. line 5D. line 8 32、Which statements about Java code security are true A. The bytecode verifier loads all classes needed for the execution of a program.B. Executing code is performed by the runtime interpreter.C. At runtime the bytecodes are loaded, checked and run in an interpreter.D. The class loader adds security by separating the namespaces for the classes of the local file system from those imported from network sources. 33、 Given the following code:public class Personint arr = new int10;public static void main(String a) System.out.println(arr1);Which statement is correct A. When compilation some error will occur.B. It is correct when compilation but will cause error when running.C. The output is zero.D. The output is null.34、public class Parent public int addValue( int a, int b) int s;s = a+b;return s;class Child extends Parent Which methods can be added into class Child A. int addValue( int a, int b )/ do something.B. public void addValue ()/ do something.C. public int addValue( int a )/ do something.D. public int addValue( int a, int b )throws MyException /do something. 35、Which statements about thread are true A. Once a thread is created, it can star running immediately.B. To use the start() method makes a thread runnable, but it does not necessarily start immediately.C. When a thread stops running because of pre-emptive, it is placed at the front end of the runnable queue.D. A thread may cease to be ready for a variety of reasons. 36、A member variable defined in a class can be accessed only by the classes in the same package. Which modifier should be used to obtain the access control A. privateB. no modifierC. publicD. protected 37、A public member vairable called MAX_LENGTH which is int type, the value of the variable remains constant value 100. Use a short statement to define the variable.A. public int MAX_LENGTH=100;B. final int MAX_LENGTH=100;C. final public int MAX_LENGTH=100;D. public final int MAX_LENGTH=100. 38、Which expressions are correct to declare an array of 10 String objects A. char str;B. char str;C. String str;D. String str10;39、Which fragments are correct in Java source file A. package testpackage;public class Test/do something.B. import java.io.*;package testpackage;public class Test/ do something.C. import java.io.*;class Person/ do something.public class Test/ do something.D. import java.io.*; import java.awt.*;public class Test/ do something. 40:String s= hello;String t = hello;char c = h,e,l,l,o ;Which return true A. s.equals(t);B. t.equals(c);C. s=t;D. t.equals(new String(hello);E. t=c. 41. Which of the following statements are legal A. long l = 4990;B. int i = 4L;C. float f = 1.1;D. double d = 34.4;E. double t = 0.9F.42、public class Parent int change() class Child extends Parent Which methods can be added into class Child A. public int change()B. int chang(int i) C. private int change() D. abstract int chang() 43、class Parent String one, two;public Parent(String a, String b)one = a;two = b;public void print() System.out.println(one); public class Child extends Parent public Child(String a, String b)super(a,b);public void print() System.out.println(one + to + two);public static void main(String arg)Parent p = new Parent(south, north); Parent t = new Child(east, west);p.print();t.print(); Which of the following is correct A. Cause error during compilation.B. southeast C. south to northeast to westD. south to northeastE. southeast to west 44、Given the uncompleted method:1)2) success = connect()3 if (success=-1) 4 throw new TimedOutException();5 6TimedOutException is not a RuntimeException. Which can complete the method of declaration when added at line 1 A. public void method()B. public void method() throws ExceptionC. public void method() throws TimedOutExceptionD. public void method() throw TimedOutExceptionE. public throw TimedOutException void method() 45、Given the following code:1) class Parent 2 private String name;3 public Parent()4 5) public class Child extends Parent 6 private String department;7 public Child() 8 public String getValue() return name; 9) public static void main(String arg) 10 Parent p = new Parent();11 12) Which line will cause error A. line 3B. line 6C. line 7D. line 8E. line 1046、The variable result is boolean. Which expressions are legal A. result = true;B. if ( result ) / do something. C. if ( result!= 0 ) / so something. D. result = 1 47、Class Teacher and Student are subclass of class Person.Person p;Teacher t;Student s;p, t and s are all non-null.if(t instanceof Person) s = (Student)t; What is the result of this sentence A. It will construct a Student object.B. The expression is legal.C. It is illegal at compilation.D. It is legal at compilation but possible illegal at runtime.48、Given the following class:public class Samplelong length;public Sample(long l) length = l; public static void main(String arg)Sample s1, s2, s3;s1 = new Sample(21L);s2 = new Sample(21L); s3 = s2;long m = 21L; Which expression returns true A. s1 = s2;B. s2 = s3;C. m = s1;D. s1.equals(m).49、Which classes can be used as the argument of the constructor of the class FilterInputStream A. FilterOutputStreamB. FileC. InputStreamD. RandomAccessFile50、Which classes can be used as the argument of the constructor of the class FileInputStream A. InputStreamB. FileC. FileOutputStreamD. String51、Which is not a method of the class InputStream A. int read(byte)B. void flush()C. void close()D. int available()52、Given the following code:class Person String name,department;public void printValue() System.out.println(name is +name);System.out.println(department is +department);public class Teacher extends Person int salary;public void printValue()/ doing the same as in the parent method printValue()/ including print the value of name and department.System.out.println(salary is +salary);Which expression can be added at the doing the same as. part of the method printValue() A. printValue(); B. this.printValue();C. person.printValue();D. super.printValue(). 53. Which of the following assignment is not correct A. float f = 11.1;B. double d = 5.3E12;C. double d = 3.14159;D. double d = 3.14D.Linux基础1. Linux文件权限一共10位长度,分成四段,第三段表示的内容是_。A 文件类型 B 文件所有者的权限 C 文件所有者所在组的权限 D 其他用户的权限2在使用mkdir命令创建新的目录时,在其父目录不存在时先创建父目录的选项是_。A -m B -d C -f D p3. 具有很多C语言的功能,又称过滤器的是 _ 。A cshB tcshC awkD sed4. 下列文件中,包含了主机名到IP地址的映射关系的文件是: _ 。A /etc/HOSTNAME B /etc/hosts C /etc/resolv.conf D /etc/networks5. 命令可以从文本文件的每一行中截取指定内容的数据。_A cp B dd C fmt D cut6对名为fido的文件用chmod 551 fido 进行了修改,则它的许可权是 _ 。A -rwxr-xr-x B -rwxr-r- C -r-r-r- D -r-xr-xx7 用ls al 命令列出下面的文件列表, _ 文件是符号连接文件。A -rw-rw-rw- 2 hel-s users 56 Sep 09 11:05 helloB -rwxrwxrwx 2 hel-s users 56 Sep 09 11:05 goodbeyC drwxr-r- 1 hel users 1024 Sep 10 08:10 zhangD lrwxr-r- 1 hel users 2024 Sep 12 08:12 cheng8在vi编辑器中的命令模式下,键入 _ 可在光标当前所在行下添加一新行。A ; B ; C ; D A9在vi编辑器中的命令模式下,重复上一次对编辑的文本进行的操作,可使用 _ 命令。A 上箭头 B 下箭头 C ; D ;10用命令ls -al显示出文件ff的描述如下所示,由此可知文件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 more 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 read19crontab文件由六个域组成,每个域之间用空格分割,其排列如下: _ 。A MIN HOUR DAY MONTH YEAR COMMANDB MIN HOUR DAY MONTH DAYOFWEEK 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张三 数学 75张三 英语 87李四 语文 76李四 数学 90李四 英语 78王五 语文 81王五 数学 100王五 英语 902. 表student1如下:自动编号 学号 姓名 课程编号 课程名称 分数1 2005001 张三 0001 数学 692 2005002 李四 0001 数学 893 2005001 张三 0001 数学 69用1条SQL删除相同的学生冗余信息(自动编号不同可忽略) 3. 一个叫player的表如下Name张三李四王五赵六 请用一条SQL语句显示出所有选手一对一比赛有可能的组合 4. 如何把这个名为aaa的表 year month amount1991 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元钱,最多可以喝到几瓶汽水?4、 一个岔路口分别通向诚实国和说谎国。来了两个人,已知一个是诚实国的,另一个是说谎国的。诚实国永远说实话,说谎国永远说谎话。现在你要去说谎国,但不知道应该走哪条路,需要问这两个人。请问应该怎么问?5、 有三顶红帽子和两顶白帽子。将其中的三顶帽子分别戴在 A、B、C三人头上。这三人每人都只能看见其他两人头上的帽子,但看不见自己头上戴的帽子,并且也不知道剩余的两顶帽子的颜色。问A:”你戴的是什么颜色的帽子?” A回答说:”不知道。” 接着,又以同样的问题问B。B想了想之后,也回答说:”不知道。” 最后问C。C回答说:”我知道我戴的帽子是什么颜色了。” 当然,C是在听了A、B的回答之后而作出回答的。试问:C戴的是什么颜色的帽子?java基础12345678910A,CA,B,EDB,DD,E BA,D,EAA,B A,D11121314151617
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 图纸专区 > 考试试卷


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!