欧美精品在欧美一区二区少妇,久久久久成人影视,99热在线精品呀,草莓视频手机在线观看

當(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è)線(xiàn)程同時(shí)試圖訪(fǎng)問(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ù)外只能直接訪(fǎng)問(wèn)靜態(tài)成員。訪(fǎng)問(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í)訪(fǎng)問(wèn)控制。請(qǐng)考生查閱高級(jí)訪(fǎng)問(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) 更多>
另类天堂在线女| 9久9久9久女女女九九九一九| 亚洲精品无码AAA片| 欧美精品在线不卡| 黑人巨大超大另类videos| 蜜桃涩涩| 久久频这里精品99香蕉| 欧美亚洲另类日韩| 美日韩人妻乱| 欧美大黄片| 无码电影在线看| 技户晴0121D4| 天天天日天天97中文| 无码亚欧激情视频在线观看| 丰满人妻精品国| 国产老熟女狂叫对白| 免费AV一区二区三区| 小77毛片| 亚洲色徒在线免费观看| 国产h片在线观看| 人妻初拍AV在线| 亚洲免费三级片| 另类成人| www欧美www| 免费人妻精品一区二区三区| 色性在线| 一级无码乳首| 亚洲天堂av无码片区| 久久久一本精品99久久精品66直播| 国产精品亚洲无码二区| 国产探花视频在线观看| 久亚洲人妻精品| 久久久亚洲AV无| 亚洲国产精品成人久久蜜臀| www.69亚洲| 777亚州视频| 国产素人在线观看| 亚洲一A少妇| 色婷婷综合久色| 精品亚洲一区二区三区四区五区高| 日本多毛熟妇|