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

當前位置:

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

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

例題10:

Which statement or statements are true about the code listed below? Choose three.

1. public class MyTextArea extends TextArea {

2. public MyTextArea(int nrows, int ncols) {

3. enableEvents(AWTEvent.TEXT_

EVENT_MASK);

4. }

5.

6. public void processTextEvent

(TextEvent te) {

7. System.out.println(“Processing a text event.”);

8. }

9. }

A. The source code must appear in a file called MyTextArea.java

B. Between lines 2 and 3, a call should be made to super(nrows, ncols) so that the new component will have the correct size.

C. At line 6, the return type of processTextEvent() should be declared boolean, not void.

D. Between lines 7 and 8, the following code should appear: return true.

E. Between lines 7 and 8, the following code should appear: super.processTextEvent(te).

解答:A, B, E

點評:由于類是public,所以文件名必須與之對應,選項A正確。如果不在2、3行之間加上super(nrows,ncols)的話,則會調(diào)用無參數(shù)構建器TextArea(), 使nrows、ncols信息丟失,故選項B正確。在Java2中,所有的事件處理方法都不返回值,選項C、D錯誤。選項E正確,因為如果不加super.processTextEvent(te),注冊的listener將不會被喚醒。

1.Which statement about the garbage collection mechanism are true?

A. Garbage collection require additional programe code in cases where multiple  threads are running.

B. The programmer can indicate that a reference through a local variable is no longer of interest.

C. The programmer has a mechanism that explicity and immediately frees the memory used by Java objects.

D. The garbage collection mechanism can free the memory used by Java Object at explection time.

E. The garbage collection system never reclaims memory from objects while are still accessible to running user threads.

1。B、E

JAVA的垃圾回收機制是通過一個后臺系統(tǒng)級線程對內(nèi)存分配情況進行跟蹤實現(xiàn)的,對程序員來說是透明的,程序員沒有任何方式使無用內(nèi)存顯示的、立即的被釋放。而且它是在程序運行期間發(fā)生的。

答案B告訴我們程序員可以使一個本地變量失去任何意義,例如給本地變量賦值為“null”;答案E告訴我們在程序運行期間不可能完全釋放內(nèi)存。

2. Give the following method:

1) public void method( ){

2) String a,b;

3) a=new String(“hello world”);

4) b=new String(“game over”);

5) System.out.println(a+b+”ok”);

6) a=null;

7) a=b;

8) System.out.println(a);

9) }

In the absence of compiler optimization, which is the earliest point the object   a refered is definitely elibile to be garbage collection.

A. before line 3

B.before line 5

C. before line 6

D.before line 7

E. Before line 9

2。D

第6行將null賦值給a以后,a以前保存的引用所指向的內(nèi)存空間就失去了作用,它可能被釋放。所以對象a可能最早被垃圾回收是在第7行以前,故選擇D選項。

3. In the class java.awt.AWTEvent,which is the parent class upon which jdk1.1 awt events are based there is a method called getID which phrase accurately describes the return value of this method?

A. It is a reference to the object directly affected by the cause of the event.

B. It is an indication of the nature of the cause of the event.

C. It is an indication of the position of the mouse when it caused the event.

D. In the case of a mouse click, it is an indication of the text under the mouse at the time of the event.

E. It tells the state of certain keys on the keybord at the time of the event.

F. It is an indication of the time at which the event occurred

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

(責任編輯:fky)

2頁,當前第1頁  第一頁  前一頁  下一頁
最近更新 考試動態(tài) 更多>
亚洲一区二区在线播放| 色色免费下载91| 肉色超薄丝袜脚交一区二区| 日韩亚洲欧美小说图片| 欧美淫娃| 免费亚洲洋洋| 国产日韩精品欧美一区| 91在线青青草原| 噜噜久久护士无码AV| www小视频| 色五天大香蕉| 日本精品一区二区| 美女自摸网站| 色尤尤在线视频| 久久九九免费视频| 亚洲另类中字图区| 悠悠影院| 高清激情诱惑无码| 国产成人久久久久久久| 国产成人av大片大片在线播放 | 国产精品视频无码| 欧美一级黄色K| 国产一区二区三区在线看| 一品道精品免费视频在| 久久久综合精品| AV日韩久久久久久| 一本色道久久综合狠狠躁篇| 亚洲精品27| 久久国产精品试| 亚洲熟妇xxxxx| 久久月丁香| 日韩高清在线高清免费| 囸产棈品视频一区无码| 88精品网| 午夜精品久久久久久毛片| 亚洲十欧美十日韩| 亚洲综合色站成人| 97人妻碰碰碰视频| 制服丝袜久久久| 欧美国产簧片| 亚洲AV无码精品一区二区|