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

當前位置:

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) 更多>
这里只有精品777| 中文字幕亚洲精品无码| 狠狠夜| 伊人久久午夜视频| 亚洲一级av无码一级久久精品| 亚洲男人成人污污网站| 亚洲一区熟| 日日夜夜精品视频| 激情人妻文学| 亚洲色一区在线观看| 欧美激情网| 伊人天堂网| 在线看无码免费黄片| 日韩AV一区二日韩一| 久久精品国产亚洲AV麻豆不卡| 中国熟妇专区| 入妻无码久久久久免费| 熟妇| 日韩色爱| 亚洲色大999| 免费播放日本黄在线| 夜色资源站www国产在线视频| 欧美不卡123| 五月 亚洲| 色哟哟免费精品网站入口| 好男人社区在线看ww| 成人看的黄色视频| 亚洲日韩中文乱码| 精品久久久久久无码不卡| 欠久操| 亚洲视频一级久日| 日韩三级在线| 亚洲天堂伊人| 久久久女教师精品| 老妇淫乱视频| 新版天堂资源中文WWW连接| 人人洗澡| a级电影免费观看不卡| 久久精品国产思思| 精品无码中文字幕在线| 伊色综合|