個公司的筆試題北京富基融通科技_第1頁
個公司的筆試題北京富基融通科技_第2頁
個公司的筆試題北京富基融通科技_第3頁
個公司的筆試題北京富基融通科技_第4頁
免費預覽已結束,剩余9頁可下載查看

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、選擇題1: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.none2:What is the result when you compile and run the fol

2、lowing code?public class ThrowsDemostatic void throwMethod()System.out.println("Inside throwMethod.");throw new IllegalAccessException("demo");public static void main(String args)trythrowMethod();catch (IllegalAccessException e)System.out.println("Caught " + e);Choices:

3、What is the result when you compile and run the following code?public class ThrowsDemostatic void throwMethod()System.out.println("Inside throwMethod.");throw new IllegalAccessException("demo");public static void main(String args)trythrowMethod();catch (IllegalAccessException e)S

4、ystem.out.println("Caught " + e);Choices:A.Compilation errorB.Runtime errorC.Compile successfully, nothing is printed.D.Inside throwMethod. followed by caught:java.lang.IllegalAccessExcption: demo3: Consider the class hierarchy shown below:class FourWheeler implements DrivingUtilitiesclass

5、 Car extends FourWheelerclass Truck extends FourWheelerclass Bus extends FourWheelerclass Crane extends FourWheelerConsider the following code below:1.DrivingUtilities du;2.FourWheeler fw;3.Truck myTruck = new Truck();4.du = (DrivingUtilities)myTruck;5.fw = new Crane();6.fw = du;Which of the stateme

6、nts below are true?Choices:A.Line 4 will not compile because an interface cannot refer to an object.B.The code will compile and run.C.The code will not compile without an explicit cast at line 6, because going down thehierarchy without casting is not allowed.D.The code will compile if we put an expl

7、icit cast at line 6 but will throw an exception atruntime.4:給出下面的代碼片斷。下面的哪些陳述為錯誤的?1) public void create() 2) Vector myVect;3) myVect = new Vector(); 4) 給出下面的代碼片斷。下面的哪些陳述為錯誤的?1) public void create() 2)3)4) Vector myVect;myVect = new Vector();A.第二行的為變量 myVect 分配內存空間。B.第二行語句創建一個 Vector 類對象。C.第三行語句創建一個

8、Vector 類對象。D.第三行語句為一個 Vector 類對象分配內存空間5:鑒于 Java 的特點,它最適合的計算環境是A.并行計算環境B.分布式計算環境C.高強度計算環境D.開放式計算環境6:Give the following java class: public class Examplepublic static void main(String args) static int x = new int15; System.out.println(x5);Which statement is corrected? Give the following java class: pub

9、lic class Examplepublic static void main(String args) static int x = new int15; System.out.println(x5);Which statement is corrected?A.When compile, some error will occur.B.When run, some error will occur.C.Output is zero.D.Output is null.7:Give the following java class: public class Examplestatic in

10、t x=new int15;public static void main(String args) System.out.println(x5);Which statement is corrected? Give the following java class: public class Examplestatic int x=new int15;public static void main(String args) System.out.println(x5);Which statement is corrected?A.When compile, some error will o

11、ccur.B.When run, some error will occur.C.Output is zero.D.Output is null.8:What will happen when you attempt to compile and run the following code?public class Staticstaticint x = 5;static int x,y;public static void main(String args)x-;myMethod();System.out.println(x + y + +x);public static void myM

12、ethod()y = x+ + +x;Choices:What will happen when you attempt to compile and run the following code?public class Staticstaticint x = 5;static int x,y;public static void main(String args)x-;myMethod();System.out.println(x + y + +x);public static void myMethod()y = x+ + +x;Choices:A.prints : 2B.prints

13、: 3C.prints : 7D.prints : 89:軟件生命周期的瀑布模型把軟件項目分為 3 個階段、8 個子階段,以下哪一個是正常的開發順序?A.計劃階段、開發階段、運行階段B.設計階段、開發階段、編碼階段C.設計階段、編碼階段、維護階段D.計劃階段、編碼階段、測試階段10:Given the following class definition:class A protected int i; A(int i) this.i=i;which of the following would be a valid inner class for this class? Select val

14、id answer:Given the following class definition:class A protected int i; A(int i) this.i=i;which of the following would be a valid inner class for this class? Select valid answer:A.class B B.class B extends A C.class B extends A B()System.out.println(“i=”+i); D.class B class A 11:Which is the most ap

15、propriate code snippet that can be inserted at line 18 in the following code?(Assume that the code is compiled and run with assertions enabled)1.import java.util.*;2.3.public class AssertTest4.5.private HashMap cctld;6.7.public AssertTest()8.9.cctld = new HashMap();10.cctld.put("in", "

16、;India");11.cctld.put("uk", "United Kingdom");12.cctld.put("au", "Australia");13./ more code.14.15./ other methods .16.public String getCountry(String countryCode)17.18./ What should be inserted here?19.String country = (String)cctld.get(countryCode);20.r

17、eturn country;21.22. Which is the most appropriate code snippet that can be inserted at line 18 in the following code?(Assume that the code is compiled and run with assertions enabled)1.import java.util.*;2.3.public class AssertTest4.5.private HashMap cctld;6.7.public AssertTest()8.9.cctld = new Has

18、hMap();10.cctld.put("in", "India");11.cctld.put("uk", "United Kingdom");12.cctld.put("au", "Australia");13./ more code.14.15./ other methods .16.public String getCountry(String countryCode)17.18./ What should be inserted here?19.String coun

19、try = (String)cctld.get(countryCode);20.return country;21.22. A.assert countryCode != null;B.assert countryCode != null : "Country code can not be null" ;C.assert cctld != null : "No country code data is available"D.assert cctld : "No country code data is available"12:T

20、he following code is entire contents of a file called Example.java,causes precisely one error durin g compilation:class SubClass extends BaseClassclass BaseClass() String str;public BaseClass() System.out.println(“ok”); public BaseClass(String s) str=s;public class Example public void method()SubCla

21、ss s=new SubClass(“hello”); BaseClass b=new BaseClass(“world”);Which line would be cause the error?The following code is entire contents of a file called Example.java,causes precisely one error during compilation:class SubClass extends BaseClassclass BaseClass() String str;public BaseClass() System.

22、out.println(“ok”); public BaseClass(String s) str=s;public class Examplepublic void method()SubClass s=new SubClass(“hello”); BaseClass b=new BaseClass(“world”);Which line would be cause the error?A.9B.10C.11D.1213:在軟件生命周期中,下列哪個說法是確的?A.軟件生命周期分為計劃、開發和運行三個階段B.在計劃階段要進行問題焉醛和需求分析C.在開發后期要進行編寫代碼和軟件測試D.在運行階段主要是進行軟件維護14:Which of the following statements are not legal?A.long l = 4990;B.int i = 4L;C.double d = 34.4;D.double t = 0.9F.15:Select valid identifier of Java: Select valid identifier

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論