常州酌乒文化传播有限公司

當前位置:

JAVA認證歷年真題:SCJP考試真題和解析7

發(fā)表時間:2014/4/21 9:54:55 來源:互聯(lián)網 點擊關注微信:關注中大網校微信
關注公眾號

19.Which declares for native method in a java class corrected?

A. public native void method(){}

B. public native void method();

C. public native method();

D. public void method(){native;}

E. public void native method();

19。B

native關鍵字指明是對本地方法的調用,在JAVA中是只能訪問但不能寫的方法,它的位置在訪問權限修飾語的后面及返回值的前面。

20. Which modifer should be applied to a declaration of a class member variable for the value of variable to remain constant after the creation of the object?

20。final

定義常量的方法是在變量定義前加final關鍵字。

21. Which is the main() method return of a application?

A. String

B. byte

C. char

D. void

21。D

main()方法沒有返回值,所以必須用void修飾。main()方法的返回值不能任意修改。

22. Which is corrected argument of main() method of application?

A. String args

B. String ar[]

C. Char args[][]

D. StringBuffer arg[]

22。B

main()方法的參數(shù)是字符串數(shù)組,參數(shù)名可以任意定義。

23. “The Employee object is a person, An Employee has appointment store in a    vector, a hire date and a number of dependent”

short answer: use shortest statement declare a class of Employee.

23。public class Employee extends Person

這也是真實考試中常見的一種題型。要注意題目敘述中“is a”表示 “extends”的含義。

24. Give the following class defination inseparate source files:

public class Example{

public Example(){//do something}

protected Example(int i){//do something}

protected void method(){//do something}

}

public class Hello extends Example{//member method and member variable}

Which methods are corrected added to the class Hello?

A. public void Example(){}

B. public void method(){}

C. protected void method(){}

D. private void method(){}

24。A、B、C

考察的知識點是方法覆蓋,其中要注意的是方法覆蓋時,子類方法的訪問權限不能小于父類方法的訪問權限。另外,選項A并不是父類構造函數(shù),它是子類中的新方法。

25. Float s=new Float(0.9F);

Float t=new Float(0.9F);

Double u=new Double(0.9);

Which expression?s result is true?

A. s==t

B. s.equals(t)

C. s==u

D. t.equals(u)

25。A、B

考察“==”及方法“equals()”的用法。注意以下幾點區(qū)別:

1) 引用類型比較引用;基本類型比較值。

2) equals()方法只能比較引用類型,“==”可比較引用及基本類型。

3) 當用equals()方法進行比較時,對類File、String、Date及封裝類(Wrapper Class)來說,是比較類型及內容。

4) 用“==”進行比較時,符號兩邊的數(shù)據(jù)類型必須一致(可相互轉換的基本類型除外),否則編譯出錯

相關鏈接JAVA認證考試報考指南  考試論壇 考試知道   考試動態(tài)

(責任編輯:fky)

2頁,當前第1頁  第一頁  前一頁  下一頁
最近更新 考試動態(tài) 更多>
南宫市| 巫山县| 南乐县| 泰顺县| 荥经县| 安图县| 侯马市| 原阳县| 宝丰县| 全州县| 临沂市| 夹江县| 鞍山市| 合作市| 来宾市| 龙江县| 紫云| 佛冈县| 青浦区| 绥宁县| 泽州县| 于都县| 恩施市| 黄陵县| 朝阳县| 郯城县| 禹城市| 诏安县| 图们市| 张家港市| 陆川县| 秭归县| 壶关县| 中宁县| 平潭县| 河西区| 荆州市| 墨玉县| 江华| 衢州市| 马山县|