一级做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ù)構(gòu)建器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) 更多>
国产精品二区三区| 乱中年女人伦AV| 丁香六月婷婷国产| wWw超碰少妇com| 黑色丝袜视频在一二区| 欧美日韩无线视频| 国产h视频| 国产精品,欧美激情| 特级西西人体444WWw高清大胆| 毛片中文字幕在线观看| 线上AV站| 日韩精品三| 亚洲第一精品极品| 久久精品72| 日韩人妻无码潮喷中文视频| 夜草草网站| 黄色自拍偷拍电影| av无码av天天av天天爽| 日韩精品少妇一区二区| 无码 搜索 国产| 免费av导航在线| 狠狠噜天天噜日日噜无码| 性视频久久久| 国产成人香臀av| 午夜男人在线播放| 日韩黄色电影院| 99国国视频在线播放| 水蜜桃亚洲一二三四在线| 超碰在线人人播放| 欧洲熟妇色xxxx欧美老妇多毛| 亚洲国产精品喷| 最新欧美色| 久久国产精品无码| 中文字幕avav| 爱爱超碰| 亚洲中文综合视频| 亚洲欧美日韩在线观看| 免费的污网站| 欧美日韩国产666| 久久婷婷综合色丁香五月 | 游戏|