JAVA模拟题:TestoftheJavaSkill(3)
百度广告
Question 17:
class Base{
public void another(){
}
public class Abs extends Base{
Abs a = new Abs();
}
System.out.println("My func");
public void amethod(){
}
A. The code will compile and run, printing out the words "My func"
B. The compiler will complain that the Base class is not declared as abstract.
C. The code will compile but complain at run time that the Base class has non abstract methods
D. The compiler will complain that the method myfunc in the base class has no body
Question 18:
What interface might be most suitable to meet this need?
A. Set
B. List
C. Map
D. Vector
Question 19:
class Background implements Runnable{
public int run(){
i++;
}//End while
}//End class
A. It will compile and the run method will print out the increasing value of i
B. It will compile and calling start will print out the increasing value of i
C. The code will cause an error at compile time
D. Compilation will cause an error because while cannot take a parameter of true
Question 20:
class Base{
System.out.println("base constructor");
Base(){
}
public class Sup extends Base{
Sup s = new Sup();
}
// Tow
public void derived(){
}
A. On the line After // One put Base(10);
B. On the line After // One put super(10);
C. On the line After // Two put super(10);
D. On the line After // Three put super(10); |||
Question 21:
A. To get to access hardware that Java does not know about
B. To define a new data type such as an unsigned integer
C. To write optimized code for performance in a language such as C/C++
D. To overcome the limitation of the private scope of a method
Question 22:
public class Arg{
public static void main(String argv){
}
System.out.println(argv[1]);
}
A. Compile time error
B. Compilation and output of "hello"
C. Compilation and output of "there"
D. None of the above
Question 23:
java myprog good morning
public class myporg{
System.out.println(argv);
}
A. myprog
B. good
C. morning
D. Exception raised: "java.lang.ArrayIndexOutOfBoundsException: 2"
Question 24:
public class Hope{
Hope h = new Hope();
protected Hope(){
System.out.println(i);
}
A. Compilation error: Constructors cannot be declared protected
C. Compilation and running with output 0 to 10
编辑推荐:
温馨提示:因考试政策、内容不断变化与调整,长理培训网站提供的以上信息仅供参考,如有异议,请考生以权威部门公布的内容为准! (责任编辑:长理培训)
点击加载更多评论>>