电话:0731-83595998
导航

JAVA模拟题:TestoftheJavaSkill(3)

来源: 2017-12-19 10:40

 百度广告

   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 

编辑推荐:

下载Word文档

温馨提示:因考试政策、内容不断变化与调整,长理培训网站提供的以上信息仅供参考,如有异议,请考生以权威部门公布的内容为准! (责任编辑:长理培训)

网络课程 新人注册送三重礼

已有 22658 名学员学习以下课程通过考试

网友评论(共0条评论)

请自觉遵守互联网相关政策法规,评论内容只代表网友观点!

最新评论

点击加载更多评论>>

精品课程

更多
10781人学习

免费试听更多

相关推荐
图书更多+
  • 电网书籍
  • 财会书籍
  • 其它工学书籍
拼团课程更多+
  • 电气拼团课程
  • 财会拼团课程
  • 其它工学拼团
热门排行

长理培训客户端 资讯,试题,视频一手掌握

去 App Store 免费下载 iOS 客户端