当前位置:首页 > 全部子站 > IT > 思科认证

Java认证模考试题(五)

来源:长理培训发布时间:2017-12-19 10:49:09

 百度广告

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

责编:罗莉

发表评论(共0条评论)
请自觉遵守互联网相关政策法规,评论内容只代表网友观点,发表审核后显示!

国家电网校园招聘考试直播课程通关班

  • 讲师:刘萍萍 / 谢楠
  • 课时:160h
  • 价格 4580

特色双名师解密新课程高频考点,送国家电网教材讲义,助力一次通关

配套通关班送国网在线题库一套

课程专业名称
讲师
课时
查看课程

国家电网招聘考试录播视频课程

  • 讲师:崔莹莹 / 刘萍萍
  • 课时:180h
  • 价格 3580

特色解密新课程高频考点,免费学习,助力一次通关

配套全套国网视频课程免费学习

课程专业名称
讲师
课时
查看课程
在线题库
面授课程更多>>
图书商城更多>>
在线报名
  • 报考专业:
    *(必填)
  • 姓名:
    *(必填)
  • 手机号码:
    *(必填)
返回顶部