电话:0731-83595998
导航

Java认证模考试题(五)

来源: 2017-12-19 10:49

 百度广告

Question: 29
A. static

B. final

C. abstract

D. No modifier can be used

Explanation: 

Correct Answer: B 29 of 60

 
Which one of the following is correct to declare a native method?

B. public native void test(){}

C. public void native test();

D. public native test(){}

Explanation: 

Correct Answer: A 30 of 60

 
Given the following definition of a class:

public class Test {

private float f = 1.0;

int m = 12;

static int n=1;

public static void main(String arg) {

Test t = new Test();

// some code...

}

}

Which of the following usage are legal?

B. this.n

C. Test.m

D. Test.n

Explanation: 

Correct Answer: A,D 31 of 60

 

||| 
Given the following code:

1) class Example{

2) String str;

3) public Example(){

4) str= example;

5) }

6) public Example(String s){

7) str=s;

8) }

9) }

10) class Demo extends Example{

11) }

12) public class Test{

13) public void f () {

14) Example ex = new Example(Good);

15) Demo d = new Demo(Good);

16) }

Which line will cause an error?

B. line 6

C. line 10

D. line 14

E. line 15

Explanation: 

Correct Answer: E 32 of 60

 
Given the following class definition in one source file:

class Base {

public Base (){ //... }

public Base ( int m ){ //... }

protected void fun( int n ){ //... }

}

public class Child extends Base{

// member methods

}

Which methods can be added into the Child class correctly?

B. void fun ( int n ){ //... }

C. protected void fun ( int n ) { //... }

D. public void fun ( int n ) { //... }

E. public m(){ //... }

Explanation: 

Correct Answer: C,D 33 of 60

 
Which statements are correct?

B. A subclass inherits all methods ( including the constructor ) from the superclass.

C. A class can implement as many interfaces as needed.

D. When a class implements an interface, it can define as many methods of the interface as needed.

Explanation: 

Correct Answer: A,C 34 of 60

编辑推荐:

下载Word文档

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

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

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

网友评论(共0条评论)

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

最新评论

点击加载更多评论>>

精品课程

更多
10781人学习

免费试听更多

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

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

去 App Store 免费下载 iOS 客户端