《大数据基础技能试题及答案资格考试教师资格考试_资格考试-教师资格考试.pdf》由会员分享,可在线阅读,更多相关《大数据基础技能试题及答案资格考试教师资格考试_资格考试-教师资格考试.pdf(19页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、 1 Java基础 1.Which of the following will compile correctly A)float f=10f;B)float f=;C)float f=;D)byte b=10b;2.Which declarations of identifiers are legal A.$persons B.TwoUsers C.*point D.this E._endline 3.Which statement of assigning a long type variable to a hexadecimal value is correct A.long numbe
2、r=345L;B.long number=0345;C.long number=0345L;D.long number=0 x345L 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=();D.String s=home director
3、y;String t=s-directory;5.Which are syntactically valid statement ati=m;B.i=b;C.i=;D.i=(30);2 E.i=.6.Which layout manager is used when the frame is resized the buttonss position in the Frame might be changed A.BorderLayout B.FlowLayout C.CardLayout D.GridLayout 7.Given the following code fragment:1)p
4、ublic 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 cre
5、ates 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.010 B.0 x10 C.08 D.0 x8 9.Which are not Java k
6、eywords A.TRUE B.sizeof C.const D.super E.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 c
7、ontents 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.其他用户的权限在使用命令创建新的目录时在其父目录不存在时先创建父目录的选项是具有很多语言的功能又称过滤器的是下列文
8、件中包含了主机名到地址的映射关系的文件是命令可以从文本文件的每一行中截取指定内容的数据对下键入可在光标当前所在行下添加一新行在编辑器中的命令模式下重复上一次对编辑的文本进行的操作可使用命令上箭头下箭头用命令示出文件的描述如下所示由此可知文件的类型为普通文件硬链接目录符号链接删除文件命令为对件可以使用的命令为在下列命令中不能显示文本文件内容的命令是文件权限读写执行的三种标志符号依次是在脚本中用来读取文件内各个域的内容并将其赋值给变量的命令是文件由六个域组成每个域之间用空格分割其排列如下用进 3 B.In Java programming language allows a class to im
9、plement 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)publ
10、ic 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(10);11 12 Which method will the statement on line 10 call A.on line 2 B.on line 3 C.on line 6 D.on line 7 13.Which are not Java primiti
11、ve types A.short B.Boolean C.unit D.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
12、 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 其他用户的权限在使用命令创建新的目录时在其父目录不存在时先创建父目录的选项是具有很多语言的功能又称过滤器的是下列文件中包含了主机名到地址的映射关系的文件是命令可以从文本文件的每一行中截取指定内容的数据对下键入可在光标当前所在行下添加一新行在编辑器中的命令模式下重复上一次对编辑的文本进行的操作可使用命令上箭头下箭头用命令示出文件的描述
13、如下所示由此可知文件的类型为普通文件硬链接目录符号链接删除文件命令为对件可以使用的命令为在下列命令中不能显示文本文件内容的命令是文件权限读写执行的三种标志符号依次是在脚本中用来读取文件内各个域的内容并将其赋值给变量的命令是文件由六个域组成每个域之间用空格分割其排列如下用进 4 16.Which keyword should be used to enable interaction with the lock of an object The flag allows exclusive access to that object.A.transient B.synchronized C.ser
14、ialize D.static 17.Which is the return type of the method main()A.int B.void C.boolean D.static 18.Given the following code:if(x0)first);else if(x-3)second);else third);Which range of x value would print the string second A.x 0 B.x -3 C.x=-3 D.x -3 19、Which of the following answer is correct to expr
15、ess the value 10 in hexadecimal number A.0 xA B.0 x16 C.0A D.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 collect
16、ion 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;其他用户的权限在使用命令创建新的目录时在其父目录不存在时先创建父目录的选项是具有很多语言的功能又称
17、过滤器的是下列文件中包含了主机名到地址的映射关系的文件是命令可以从文本文件的每一行中截取指定内容的数据对下键入可在光标当前所在行下添加一新行在编辑器中的命令模式下重复上一次对编辑的文本进行的操作可使用命令上箭头下箭头用命令示出文件的描述如下所示由此可知文件的类型为普通文件硬链接目录符号链接删除文件命令为对件可以使用的命令为在下列命令中不能显示文本文件内容的命令是文件权限读写执行的三种标志符号依次是在脚本中用来读取文件内各个域的内容并将其赋值给变量的命令是文件由六个域组成每个域之间用空格分割其排列如下用进 5 5 public static void main(String arg)6 Test
18、 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 3 B.line 5 C.line 6 D.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
19、a)name=n;age=a;public Person(String n,String d,int a).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 dec
20、lared 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();condition 1);catch(ArrayIndexOutOfBoundsException e)condition 2);catch(Exception e)condition
21、 3);finally 其他用户的权限在使用命令创建新的目录时在其父目录不存在时先创建父目录的选项是具有很多语言的功能又称过滤器的是下列文件中包含了主机名到地址的映射关系的文件是命令可以从文本文件的每一行中截取指定内容的数据对下键入可在光标当前所在行下添加一新行在编辑器中的命令模式下重复上一次对编辑的文本进行的操作可使用命令上箭头下箭头用命令示出文件的描述如下所示由此可知文件的类型为普通文件硬链接目录符号链接删除文件命令为对件可以使用的命令为在下列命令中不能显示文本文件内容的命令是文件权限读写执行的三种标志符号依次是在脚本中用来读取文件内各个域的内容并将其赋值给变量的命令是文件由六个域组成每个
22、域之间用空格分割其排列如下用进 6 finally);Which will display if oneMethod run normally A.condition 1 B.condition 2 C.condition 3 D.finally 25、Given the following code:public class Test void printValue(int m)do The value is+m);while(-m 10)public static void main(String arg)int i=10;Test t=new Test();(i);Which will
23、be output A.The value is 8 B.The value is 9 C.The value is 10 D.The value is 11 26、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 boo
24、lean,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 d
25、ocumentation which sections are included in a class document 其他用户的权限在使用命令创建新的目录时在其父目录不存在时先创建父目录的选项是具有很多语言的功能又称过滤器的是下列文件中包含了主机名到地址的映射关系的文件是命令可以从文本文件的每一行中截取指定内容的数据对下键入可在光标当前所在行下添加一新行在编辑器中的命令模式下重复上一次对编辑的文本进行的操作可使用命令上箭头下箭头用命令示出文件的描述如下所示由此可知文件的类型为普通文件硬链接目录符号链接删除文件命令为对件可以使用的命令为在下列命令中不能显示文本文件内容的命令是文件权限读写执行
26、的三种标志符号依次是在脚本中用来读取文件内各个域的内容并将其赋值给变量的命令是文件由六个域组成每个域之间用空格分割其排列如下用进 7 A.The description of the class and its purpose B.A list of methods in its super class C.A list of member variable D.The class hierarchy 28、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)(The
27、value of j is +j);7)k=k+1;8)i-;9)10 Which line might cause an error during compilation A.line 4 B.line 6 C.line 7 D.line 8 29、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 a
28、lso 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 di
29、rectly outside the class.Which modifier should be used to obtain the access control A.public B.no modifier C.protected D.private 31、Given the following code fragment:1)String str=null;2)if(str!=null)&()10)3 more than 10);4 5)else if(str!=null)&()5)其他用户的权限在使用命令创建新的目录时在其父目录不存在时先创建父目录的选项是具有很多语言的功能又称过滤器
30、的是下列文件中包含了主机名到地址的映射关系的文件是命令可以从文本文件的每一行中截取指定内容的数据对下键入可在光标当前所在行下添加一新行在编辑器中的命令模式下重复上一次对编辑的文本进行的操作可使用命令上箭头下箭头用命令示出文件的描述如下所示由此可知文件的类型为普通文件硬链接目录符号链接删除文件命令为对件可以使用的命令为在下列命令中不能显示文本文件内容的命令是文件权限读写执行的三种标志符号依次是在脚本中用来读取文件内各个域的内容并将其赋值给变量的命令是文件由六个域组成每个域之间用空格分割其排列如下用进 8 6 less than 5);7 8)else end);Which line will c
31、ause error A.line 1 B.line 2 C.line 5 D.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 in
32、terpreter.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 Person int arr=new int10;public static void main(String a)Which statement is correct A.When compilation s
33、ome 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,in
34、t b).B.public void addValue().C.public int addValue(int a).D.public int addValue(int a,int b)throws MyException.35、Which statements about thread are true 其他用户的权限在使用命令创建新的目录时在其父目录不存在时先创建父目录的选项是具有很多语言的功能又称过滤器的是下列文件中包含了主机名到地址的映射关系的文件是命令可以从文本文件的每一行中截取指定内容的数据对下键入可在光标当前所在行下添加一新行在编辑器中的命令模式下重复上一次对编辑的文本进行的操作
35、可使用命令上箭头下箭头用命令示出文件的描述如下所示由此可知文件的类型为普通文件硬链接目录符号链接删除文件命令为对件可以使用的命令为在下列命令中不能显示文本文件内容的命令是文件权限读写执行的三种标志符号依次是在脚本中用来读取文件内各个域的内容并将其赋值给变量的命令是文件由六个域组成每个域之间用空格分割其排列如下用进 9 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 st
36、art 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
37、used to obtain the access control A.private B.no modifier C.public D.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.fi
38、nal 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.B.import.*;package te
39、stpackage;public class Test.C.import.*;class Person.public class Test.D.import.*;import.*;public class Test.40:String s=hello;其他用户的权限在使用命令创建新的目录时在其父目录不存在时先创建父目录的选项是具有很多语言的功能又称过滤器的是下列文件中包含了主机名到地址的映射关系的文件是命令可以从文本文件的每一行中截取指定内容的数据对下键入可在光标当前所在行下添加一新行在编辑器中的命令模式下重复上一次对编辑的文本进行的操作可使用命令上箭头下箭头用命令示出文件的描述如下所示由此可
40、知文件的类型为普通文件硬链接目录符号链接删除文件命令为对件可以使用的命令为在下列命令中不能显示文本文件内容的命令是文件权限读写执行的三种标志符号依次是在脚本中用来读取文件内各个域的内容并将其赋值给变量的命令是文件由六个域组成每个域之间用空格分割其排列如下用进 1 0 String t=hello;char c=h,e,l,l,o;Which return true A.(t);B.(c);C.s=t;D.(new String(hello);E.t=c.41.Which of the following statements are legal A.long l=4990;B.int i=4L
41、;C.float f=;D.double d=;E.double t=.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;
42、public void print()public class Child extends Parent public Child(String a,String b)super(a,b);public void print()+to +two);其他用户的权限在使用命令创建新的目录时在其父目录不存在时先创建父目录的选项是具有很多语言的功能又称过滤器的是下列文件中包含了主机名到地址的映射关系的文件是命令可以从文本文件的每一行中截取指定内容的数据对下键入可在光标当前所在行下添加一新行在编辑器中的命令模式下重复上一次对编辑的文本进行的操作可使用命令上箭头下箭头用命令示出文件的描述如下所示由此可知文
43、件的类型为普通文件硬链接目录符号链接删除文件命令为对件可以使用的命令为在下列命令中不能显示文本文件内容的命令是文件权限读写执行的三种标志符号依次是在脚本中用来读取文件内各个域的内容并将其赋值给变量的命令是文件由六个域组成每个域之间用空格分割其排列如下用进 1 1 public static void main(String arg)Parent p=new Parent(south,north);Parent t=new Child(east,west);();();Which of the following is correct A.Cause error during compilati
44、on.B.south east C.south to north east to west D.south to north east E.south east to west 44、Given the uncompleted method:1)2)success=connect()3 if(success=-1)4 throw new TimedOutException();5 6 TimedOutException is not a RuntimeException.Which can complete the method of declaration when added at lin
45、e 1 A.public void method()B.public void method()throws Exception C.public void method()throws TimedOutException D.public void method()throw TimedOutException E.public throw TimedOutException void method()45、Given the following code:1)class Parent 2 private String name;3 public Parent()4 5)public cla
46、ss Child extends Parent 6 private String department;7 public Child()8 public String getValue()return name;其他用户的权限在使用命令创建新的目录时在其父目录不存在时先创建父目录的选项是具有很多语言的功能又称过滤器的是下列文件中包含了主机名到地址的映射关系的文件是命令可以从文本文件的每一行中截取指定内容的数据对下键入可在光标当前所在行下添加一新行在编辑器中的命令模式下重复上一次对编辑的文本进行的操作可使用命令上箭头下箭头用命令示出文件的描述如下所示由此可知文件的类型为普通文件硬链接目录符号链接
47、删除文件命令为对件可以使用的命令为在下列命令中不能显示文本文件内容的命令是文件权限读写执行的三种标志符号依次是在脚本中用来读取文件内各个域的内容并将其赋值给变量的命令是文件由六个域组成每个域之间用空格分割其排列如下用进 1 2 9)public static void main(String arg)10 Parent p=new Parent();11 12)Which line will cause error A.line 3 B.line 6 C.line 7 D.line 8 E.line 10 46、The variable result is boolean.Which expr
48、essions are legal A.result=true;B.if(result).C.if(result!=0).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
49、 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 Sample long 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;l
50、ong m=21L;Which expression returns true A.s1=s2;其他用户的权限在使用命令创建新的目录时在其父目录不存在时先创建父目录的选项是具有很多语言的功能又称过滤器的是下列文件中包含了主机名到地址的映射关系的文件是命令可以从文本文件的每一行中截取指定内容的数据对下键入可在光标当前所在行下添加一新行在编辑器中的命令模式下重复上一次对编辑的文本进行的操作可使用命令上箭头下箭头用命令示出文件的描述如下所示由此可知文件的类型为普通文件硬链接目录符号链接删除文件命令为对件可以使用的命令为在下列命令中不能显示文本文件内容的命令是文件权限读写执行的三种标志符号依次是在脚本