好吊妞这里只有精品_美女视频黄a视频全免费应用_亚洲区一二三四区2021_色多多污污下载

當前位置:

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

發表時間:2014/4/21 9:54:51 來源:互聯網 點擊關注微信:關注中大網校微信
關注公眾號

3。B

請查閱JAVA類庫。getID方法的返回值是“event type”。在認證考試中,總會有類似的書本以外的知識,這只能靠多實踐來增長知識了。

4. Which statement about listener is true?

A. Most component allow multiple listeners to be added.

B. If multiple listener be add to a single component, the event only affected one listener.

C. Component don?t allow multiple listeners to be add.

D. The listener mechanism allows you to call an addXxxxListener method as many times as is needed, specifying as many different listeners as your design require.

4。A、D

控件可以同時使用多個“addXxxxListener”方法加入多個監聽器。并且當多個監聽器加入到同一控件中時,事件可以響應多個監聽器,響應是沒有固定順序的。

5.Give the following code:

public class Example{

public static void main(String args[] ){

int l=0;

do{

System.out.println(“Doing it for l is:”+l);

}while(--l>0)

System.out.println(“Finish”);

}

}

Which well be output:

A. Doing it for l is 3

B. Doing it for l is 1

C. Doing it for l is 2

D. Doing it for l is 0

E. Doing it for l is ?C1

F. Finish

5。D、F

本題主要考察考生對流程控制的掌握情況。這是當型循環,條件為真執行,條件為假則退出。循環體至少執行一次,故會輸出D。循環體以外的語句總會被執行,故輸出F。

6. Give the code fragment:

1) switch(x){

2) case 1:System.out.println(“Test 1”);break;

3) case 2:

4) case 3:System.out.println(“Test 2”);break;

5) default:System.out.println(“end”);

6) }

which value of x would cause “Test 2” to the output:

A. 1

B. 2

C. 3

D. default

6。B.C

在開關語句中,標號總是不被當做語句的一部分,標號的作用就是做為條件判斷而已,一旦匹配成功,就執行其后的語句,一直遭遇break語句為止。(包括default語句在內)

7. Give incompleted method:

1)

2) { if(unsafe()){//do something…}

3) else if(safe()){//do the other…}

4) }

The method unsafe() well throe an IOException, which completes the method of declaration when added at line one?

A. public IOException methodName()

B. public void methodName()

C. public void methodName() throw IOException

D. public void methodName() throws IOException

E. public void methodName() throws Exception

7。D、F

IOException異常類是Exception的子類。根據多態性的定義,IOException對象也可以被認為是Exception類型。還要注意在方法聲明中拋出異常應用關鍵字“throws”。

8. Give the code fragment:

if(x>4){

System.out.println(“Test 1”);}

else if (x>9){

System.out.println(“Test 2”);}

else {

System.out.println(“Test 3”);}

Which range of value x would produce of output “Test 2”?

A. x<4

B. x>4

C. x>9

D. None

8。D

只有兩種情況:大于4時輸出“Test1”,小于等于4時輸出“Test3”。

9. Give the following method:

public void example(){

try{

unsafe();

System.out.println(“Test1”);

}catch(SafeException e){System.out.println(“Test 2”);

}finally{System.out.println(“Test 3”);}

System.out.println(“Test 4”);

Which will display if method unsafe () run normally?

A. Test 1

B. Test 2

C. Test 3

D. Test 4

9。A、C、D

在正常情況下,打印Test1、Test3、Test4;在產生可捕獲異常時打印Test2、Test3、Test4;在產生不可捕獲異常時,打印Test3,然后終止程序。注意finally后面的語句總是被執行。

10. Which method you define as the starting point of new thread in a class from which new the thread can be excution?

A. public void start()

B. public void run()

C. public void int()

D. public static void main(String args[])

E. public void runnable()

10。B

線程的執行是從方法“run( )”開始的,該方法是由系統調用的。程序員手工調用方法start(),使線程變為可運行狀態

相關鏈接JAVA認證考試報考指南  考試論壇 考試知道   考試動態

(責任編輯:fky)

2頁,當前第1頁  第一頁  前一頁  下一頁
最近更新 考試動態 更多>

考試科目