一级做a爱片,色站综合,99偷拍视频精品一区二区,亚洲精品色无码AV

當(dāng)前位置:

JAVA認(rèn)證歷年真題:SCJP考試真題和解析6

發(fā)表時(shí)間:2014/4/21 9:54:55 來(lái)源:互聯(lián)網(wǎng) 點(diǎn)擊關(guān)注微信:關(guān)注中大網(wǎng)校微信
關(guān)注公眾號(hào)

11.Given the following class definition:

class A{

protected int i;

A(int i){

this.i=i;

}

}

which of the following would be a valid inner class for this class?

Select all valid answers:

A. class B{

}

B. class B extends A{

}

C. class B extends A{

B(){System.out.println(“i=”+i);}

}

D. class B{

class A{}

}

E. class A{}

11。A

此題考查內(nèi)部類(lèi)及關(guān)鍵字“super”的用法。內(nèi)部類(lèi)不能與外部類(lèi)同名。另外,當(dāng)B繼承A?xí)r,A中的構(gòu)造函數(shù)是帶參數(shù)的,B中缺省構(gòu)造函數(shù)的函數(shù)體為空;而JAVA編譯器會(huì)為空構(gòu)造函數(shù)體自動(dòng)添加語(yǔ)句“super();”調(diào)用父類(lèi)構(gòu)造函數(shù),更進(jìn)一步是調(diào)用父類(lèi)的參數(shù)為空的構(gòu)造函數(shù)。而父類(lèi)中沒(méi)有參數(shù)為空的構(gòu)造函數(shù)。

12. Which modifier should be applied to a method for the lock of object this to be obtained prior to excution any of the method body?

A. synchronized

B. abstract

C. final

D. static

E. public

12。A

此關(guān)鍵字可以在兩個(gè)線程同時(shí)試圖訪問(wèn)某一數(shù)據(jù)時(shí)避免數(shù)據(jù)毀損。

13. The following code is entire contents of a file called Example.java,causes precisely one error during compilation:

1) class SubClass extends BaseClass{

2) }

3) class BaseClass(){

4) String str;

5) public BaseClass(){

6) System.out.println(“ok”);}

7) public BaseClass(String s){

8) str=s;}}

9) public class Example{

10) public void method(){

11) SubClass s=new SubClass(“hello”);

12) BaseClass b=new BaseClass(“world”);

13) }

14) }

Which line would be cause the error?

A. 9 B. 10 C. 11 D.12

13。C

當(dāng)一個(gè)類(lèi)中未顯式定義構(gòu)造函數(shù)時(shí),缺省的構(gòu)造函數(shù)是以類(lèi)名為函數(shù)名,參數(shù)為空,函數(shù)體為空。雖然父類(lèi)中的某一構(gòu)造函數(shù)有字符串參數(shù)s,但是子類(lèi)繼承父類(lèi)時(shí)并不繼承構(gòu)造函數(shù),所以它只能使用缺省構(gòu)造函數(shù)。故在第11行出錯(cuò)。

14. Which statement is correctly declare a variable a which is suitable for refering to an array of 50 string empty object?

A. String [] a

B. String a[]

C. char a[][]

D. String a[50]

F. Object a[50]

14。A、B

注意,題中問(wèn)的是如何正確聲明一個(gè)一維數(shù)組,并非實(shí)例化或者初始化數(shù)組

15. Give the following java source fragement:

//point x

public class Interesting{

//do something

}

Which statement is correctly Java syntax at point x?

A. import java.awt.*;

B.package mypackage

C. static int PI=3.14

D. public class MyClass{//do other thing…} E. class MyClass{//do something…}

15。A、E

X處可以是一個(gè)輸入,包的定義,類(lèi)的定義。由于常量或變量的聲明只能在類(lèi)中或方法中,故不能選擇C;由于在一個(gè)文件中只能有一個(gè)public類(lèi),故不能選擇D。

16. Give this class outline:

class Example{

private int x;

//rest of class body…

}

Assuming that x invoked by the code java Example, which statement can made x be directly accessible in main() method of Example.java?

A. Change private int x to public int x

B. change private int x to static int x

C. Change private int x to protected int x

D. change private int x to final int x

16。B

靜態(tài)方法除了自己的參數(shù)外只能直接訪問(wèn)靜態(tài)成員。訪問(wèn)非靜態(tài)成員,必須先實(shí)例化本類(lèi)的一個(gè)實(shí)例,再用實(shí)例名點(diǎn)取。

17. the piece of preliminary analsis work describes a class that will be used frequently in many unrelated parts of a project

“The polygon object is a drawable, A polygon has vertex information stored in a vector, a color, length and width.”

Which Data type would be used?

A. Vector

B. int

C. String

D. Color

E. Date

17。A、B、D

polygon的頂點(diǎn)信息存放在Vector類(lèi)型的對(duì)象內(nèi)部,color定義為Color,length和width定義為int。

注意,這是考試中常見(jiàn)的題型。

18. A class design requires that a member variable should be accessible only by same package, which modifer word should be used?

A. protected

B. public

C. no modifer

D. private

18。C

此題考點(diǎn)是高級(jí)訪問(wèn)控制。請(qǐng)考生查閱高級(jí)訪問(wèn)控制說(shuō)明表格。

相關(guān)鏈接JAVA認(rèn)證考試報(bào)考指南  考試論壇 考試知道   考試動(dòng)態(tài)

(責(zé)任編輯:fky)

2頁(yè),當(dāng)前第1頁(yè)  第一頁(yè)  前一頁(yè)  下一頁(yè)
最近更新 考試動(dòng)態(tài) 更多>
亚洲色图2019在线| 一本久久久| 啊啊啊www啊啊| 嫩草嫩草嫩草| 日韩乱码久久久久久久| 69国产成人精品二区| 一区二区中文字幕| 黄色无码婷婷五月天| 色狠狠五月激情综合| 精品福利一区二区视频 | 亚洲福利电影”| 国产乱子伦农村叉叉叉| 不卡的高清无码视频| 久久人妻精品中文字幕| 欧美偷拍综合| www.天天爽| AV野花| 亚洲欧美熟妇综合久久九色| 极品后入美女少妇| 欧美日韩国产精品激情| 日本乱人伦在线观看| 国产丝袜三级片| 在线观看日本网址8x| 永久免费无码网站在线观看| 日韩欧美亚洲人妻| 在线小视频 国产| 日韩av无区中文码| 很很鲁很很操| 亚洲AⅤ区| 国产超碰人人做人人爱ⅴa| 色先锋在线| 亚洲图片自拍P| 国产电影一区| 亚州综合色| 性色不卡V| 亚洲午夜久久久精品影院| 一本成人综合| 欧美午夜黄色免费| 国产精品无码一区二区三区| ytlti.cn| 日本在线观看视频网站|