版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
1、java程序員認證考試試題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
2、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.2. Give
3、 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
4、 elibile to be garbage collection.A. before line 3B.before line 5C. before line 6D.before line 7E. Before line 93. 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
5、 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 th
6、e 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.4. Which statement about listener is true?A. Most component allow multiple listeners to be added.B. If multiple listener be ad
7、d 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.5.Give the following co
8、de:public class Examplepublic static void main(String args )int l=0;doSystem.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 3B. Doing it for l is 1C. Doing it for l is 2D. Doing it for l is 0E. Doing it for l is ?C1F. Finish6.
9、 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. 1B. 2C. 3D. default7. Give incompleted method:1)2) if(unsafe()/do som
10、ething3) else if(safe()/do the other4) 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 IOExceptionD. public void methodName() throws IOExcept
11、ionE. public void methodName() throws Exception8. 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<4B. x>4C. x>9D. None9. Give the followi
12、ng method:public void example()tryunsafe();System.out.println(“Test1”);catch(SafeException e)System.out.println(“Test 2”);finallySystem.out.println(“Test 3”);System.out.println(“Test 4”);Which will display if method unsafe () run normally?A. Test 1B. Test 2C. Test 3D. Test 410. Which method you defi
13、ne 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()11.Given the following class definition:class Aprotected int i;A(int i)this.i=i;wh
14、ich of the following would be a valid inner class for this class?Select all valid answers:A. class BB. class B extends AC. class B extends AB()System.out.println(“i=”+i);D. class Bclass AE. class A12. Which modifier should be applied to a method for the lock of object this to be obtained prior to ex
15、cution any of the method body?A. synchronizedB. abstractC. finalD. staticE. public13. The following code is entire contents of a file called Example.java,causes precisely one error during compilation:1) class SubClass extends BaseClass2) 3) class BaseClass()4) String str;5) public BaseClass()6) Syst
16、em.out.println(“ok”);7) public BaseClass(String s)8) str=s;9) public class Example10) public void method()11) SubClass s=new SubClass(“hello”);12) BaseClass b=new BaseClass(“world”);13) 14) Which line would be cause the error?A. 9 B. 10 C. 11 D.1214. Which statement is correctly declare a variable a
17、 which is suitable for refering to an array of 50 string empty object?A. String aB. String aC. char aD. String a50F. Object a5015. Give the following java source fragement:/point xpublic class Interesting/do somethingWhich statement is correctly Java syntax at point x?A. import java.awt.*;B.package
18、mypackageC. static int PI=3.14D. public class MyClass/do other thing E. class MyClass/do something16. Give this class outline:class Exampleprivate int x;/rest of class bodyAssuming that x invoked by the code java Example, which statement can made x be directly accessible in main() method of Example.
19、java?A. Change private int x to public int xB. change private int x to static int xC. Change private int x to protected int xD. change private int x to final int x17. the piece of preliminary analsis work describes a class that will be used frequently in many unrelated parts of a project“The polygon
20、 object is a drawable, A polygon has vertex information stored in a vector, a color, length and width.”Which Data type would be used?A. VectorB. intC. StringD. ColorE. Date18. A class design requires that a member variable should be accessible only by same package, which modifer word should be used?
21、A. protectedB. publicC. no modiferD. private19.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();20. Which modifer should be applied to a decla
22、ration of a class member variable for the value of variable to remain constant after the creation of the object?21. Which is the main() method return of a application?A. StringB. byteC. charD. void22. Which is corrected argument of main() method of application?A. String argsB. String arC. Char argsD. StringBuffer arg23. “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.24. Give the following class defination inseparate source fil
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 個人抵押貸款合同季度范本
- 臨街店鋪購買合同范本
- 二次供水設備采購合同
- 專業(yè)服裝管理軟件經(jīng)銷合同書
- 上海市股權轉(zhuǎn)讓合同標準范本
- 二手房銷售代理合同協(xié)議
- 中外合作種植戰(zhàn)略合作合同
- 云計算服務提供商數(shù)據(jù)保密合同
- 返聘人員協(xié)議書
- IT行業(yè)員工培訓勞動合同范本
- (2024)甘肅省公務員考試《行測》真題及答案解析
- 醫(yī)院醫(yī)務人員醫(yī)德考評標準
- 小紅書種草營銷師(初級)認證考試真題試題庫(含答案)
- 癲癇病人的護理(課件)
- 企業(yè)資產(chǎn)管理培訓
- 2024年WPS計算機二級考試題庫350題(含答案)
- 2024年4月27日浙江省事業(yè)單位招聘《職業(yè)能力傾向測驗》試題
- 2024年6月浙江省高考地理試卷真題(含答案逐題解析)
- 醫(yī)院培訓課件:《如何撰寫護理科研標書》
- 河南省鄭州市2023-2024學年高二上學期期末考試 數(shù)學 含答案
- 2024年山東省濟南市中考英語試題卷(含答案)
評論
0/150
提交評論