<dfn id="w48us"></dfn><ul id="w48us"></ul>
  • <ul id="w48us"></ul>
  • <del id="w48us"></del>
    <ul id="w48us"></ul>
  • java軟件開發工程師筆試題

    時間:2022-10-26 23:04:48 筆試題目 我要投稿
    • 相關推薦

    java軟件開發工程師筆試題

      選擇題

    java軟件開發工程師筆試題

      1:

      In the following code, which is the earliest statement, where the object originally held in e, may be garbage collected:

      1.public class Test {

      2. public static void main (String args []) {

      3. Employee e = new Employee("Bob", 48);

      4. e.calculatePay();

      5. System.out.println(e.printDetails());

      6. e = null;

      7. e = new Employee("Denise", 36);

      8. e.calculatePay();

      9. System.out.println(e.printDetails());

      10. }

      11.}

      Only One:

      In the following code, which is the earliest statement, where the object originally held in e, may be garbage collected:

      1.public class Test {

      2. public static void main (String args []) {

      3. Employee e = new Employee("Bob", 48);

      4. e.calculatePay();

      5. System.out.println(e.printDetails());

      6. e = null;

      7. e = new Employee("Denise", 36);

      8. e.calculatePay();

      9. System.out.println(e.printDetails());

      10. }

      11.}

      Only One:

      A.Line 10

      B.Line 11

      C.Line 7

      D.Line 8

      2:Exhibit :

      1. public class test (

      2. private static int j = 0;

      3.

      4. private static boolean methodB(int k) (

      5. j += k;

      6. return true;

      6. )

      7.

      8. public static void methodA(int i) {

      9. boolean b:

      10. b = i < 10 | methodB (4);

      11. b = i < 10 || methodB (8);

      12. )

      13.

      14. public static void main (String args[] } (

      15. methodA (0);

      16. system.out.printIn(j);

      17. )

      18. )

      What is the result?

      A.The program prints “0”

      B.The program prints “4”

      C.The program prints “8”

      D.The program prints “12”

      3:What is written to the standard output given the following statement:System.out.println(4|7);

      Select the right answer:

      A.4

      B.5

      C.6

      D.7

      4:

      Select valid identifier of Java:

      Select valid identifier of Java:

      A.%passwd

      B.3d_game

      C.$charge

      D.this

      5:設有變量說明語句int a=1,b=0;

      則執行以下程序段的輸出結果為( )。

      switch (a)

      {

      case 1:

      switch (b)

      {

      case 0:printf("**0**");break;

      case 1:printf("**1**");break;

      }

      case 2:printf("**2**");break;

      }

      printf(" ");

      A.**0**

      B.**0****2**

      C.**0****1****2**

      D.有語法錯誤

      6:In the following pieces of code, which one will compile without any error?

      A.StringBuffer sb1 = "abcd";

      B.Boolean b = new Boolean("abcd");

      C.C: byte b = 255;

      D.float fl = 1.2;

      7:

      What is the result when you compile and run the following code?

      public class ThrowsDemo

      {

      static void throwMethod()

      {

      System.out.println("Inside throwMethod.");

      throw new IllegalAccessException("demo");

      }

      public static void main(String args[])

      {

      try

      {

      throwMethod();

      }

      catch (IllegalAccessException e)

      {

      System.out.println("Caught " + e);

      }

      }

      }

      Choices:

      What is the result when you compile and run the following code?

      public class ThrowsDemo

      {

      static void throwMethod()

      {

      System.out.println("Inside throwMethod.");

      throw new IllegalAccessException("demo");

      }

      public static void main(String args[])

      {

      try

      {

      throwMethod();

      }

      catch (IllegalAccessException e)

      {

      System.out.println("Caught " + e);

      }

      }

      }

      Choices:

      A.Compilation error

      B.Runtime error

      C.Compile successfully, nothing is printed.

      D.Inside throwMethod. followed by caught:java.lang.IllegalAccessExcption: demo

      8: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.

      9:

      Give the following java class:

      public class Example{

      public static void main(String args[]){

      static int x[] = new int[15];

      System.out.println(x[5]);

      }

      }

      Which statement is corrected?

      Give the following java class:

      public class Example{

      public static void main(String args[]){

      static int x[] = new int[15];

      System.out.println(x[5]);

      }

      }

      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.

      10:下面關于變量及其范圍的陳述哪些是錯的。

      A.實例變量是類的成員變量。

      B.實例變量用關鍵字static聲明。

      C.在方法中定義的局部變量在該方法被執行時創建

      D.局部變量在使用前必須被初始化。

      11:

      public class X{

      public Object m(){

      Object o = new Float(3.14F);//line 3

      Object [] oa = new Object[1];//line 4

      oa[0] = o;//line 5

      o=null;//line 6

      return oa[0];//line 7

      }

      }

      When is the Float object, created in line 3,eligible for garbage collection?

      public class X{

      public Object m(){

      Object o = new Float(3.14F);//line 3

      Object [] oa = new Object[1];//line 4

      oa[0] = o;//line 5

      o=null;//line 6

      return oa[0];//line 7

      }

      }

      When is the Float object, created in line 3,eligible for garbage collection?

      A.just after line 5.

      B.just after line 6

      C.just after line 7(that is,as the method returns)

      D.never in this method

      12:

      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 AssertTest

      4. {

      5. private HashMap cctld;

      6.

      7. public AssertTest()

      8. {

      9. cctld = new HashMap();

      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 country = (String)cctld.get(countryCode);

      20. return 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 AssertTest

      4. {

      5. private HashMap cctld;

      6.

      7. public AssertTest()

      8. {

      9. cctld = new HashMap();

      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 country = (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";

      13:

      Give the following code:

      public class Example{

      public static void main(String args[] ){

      int l=0;

      do{

      System.out.println(“Doing it for l is:”+l);

      }while(--l>0)

      System.out.println(“Finish”);

      }

      }

      Which well be output:

      Give the following code:

      public class Example{

      public static void main(String args[] ){

      int l=0;

      do{

      System.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 3

      B.Doing it for l is 1

      C.Doing it for l is 2

      D.Doing it for l is 0

      14:Which statements about Java code security are not true?

      A.The bytecode verifier loads all classes needed for the execution of a program.

      B.Executing code is performed by the runtime interpreter.

      C.At runtime the bytecodes are loaded, checked and run in an interpreter.

      D.The class loader adds security by separating the namespaces for the classes of the local file system from those imported from network sources.

      15:A class design requires that a member variable should be accessible only by same package, which modifer word should be used?

      A.protected

      B.public

      C.no modifer

      D.private

      16:Character流與Byte流的區別是

      A.每次讀入的字節數不同

      B.前者帶有緩沖,后者沒有

      C.前者是塊讀寫,后者是字節讀寫

      D.二者沒有區別,可以互換使用

      簡答題

      17:找出兩個字符串中最大子字符串,如"abractyeyt","dgdsaeactyey"的最大子串為"actyet"

      18:假設你有一個用1001個整數組成的數組,這些整數是任意排列的,但是你知道所有的整數都在1到1000(包括1000)之間。此外,除一個數字出現兩次外,其他所有數字只出現一次。假設你只能對這個數組做一次處理,用一種算法找出重復的那個數字。如果你在運算中使用了輔助的存儲方式,那么你能找到不用這種方式的算法嗎?

      19:到底在哪里使用cascade="..."?

      20:使用tomcat部署應用程序 遇到過java.lang.OutOfMemoryError 嗎?如何解決的。

      21:請寫一個java程序實現數據庫緩沖池的功能?

      22:有200個正整數,且每個數均在1000至9999之間。請編制函數,其函數的功能是:要求按每個數的后三位的大小進行升序排列,然后取出滿足此條件的前10個數依次存入數組bb中,如果后三位的數值相等,則按原先的數值進行降序排列。

      23:Anonymous Inner Class (匿名內部類) 是否可以extends(繼承)其它類,是否可以implements(實現)interface(接口)?

      24:找出字符串A中包含的字符可以進行的所有不同組合。例如:abccd中,ab,ac,bc,cc,abd等都是可能的組合。

      25:下面的代碼在絕大部分時間內都運行得很正常,請問在什么情況下會出現問題?問題的根源在哪里?

      import java.util.LinkedList;

      public class Stack {

      LinkedList list = new LinkedList();

      public synchronized void push(Object x) {

      synchronized(list) {

      list.addLast( x );

      notify();

      }

      }

      public synchronized Object pop()

      throws Exception {

      synchronized(list) {

      if( list.size() <= 0 ) {

      wait();

      }

      return list.removeLast();

    【java軟件開發工程師筆試題】相關文章:

    Java工程師面試題03-29

    java軟件開發工程師簡歷范文12-06

    Java軟件開發工程師個人簡歷模板02-02

    java軟件開發工程師個人簡歷范文03-09

    Java軟件開發工程師個人簡歷模板05-28

    java中級工程師面試題03-30

    java軟件開發簡歷11-30

    Java軟件開發工程師個人簡歷范文模板06-03

    電子商務java軟件開發工程師簡歷范文03-11

    中興Java Web開發工程師筆試題及答案02-10

    主站蜘蛛池模板: 亚洲一二成人精品区| 精品国产一级在线观看| 91精品国产自产在线观看| 伊人 久久 精品 | 精品精品国产高清a毛片牛牛| 人妻VA精品VA欧美VA| 你懂的国产精品| 精品国产a∨无码一区二区三区| 久久精品国产99久久丝袜| 久久这里只有精品久久| 蜜国产精品jk白丝AV网站| 欧美精品亚洲精品日韩专区| 成人午夜精品久久久久久久小说 | 亚洲国产另类久久久精品| 国产精品一区二区三区免费| 国产高清在线精品一区| 无码日韩精品一区二区免费暖暖 | 国产精品成人久久久久久久| 国产午夜精品一区理论片| 精品无人区一区二区三区| 一级A毛片免费观看久久精品| 久久久久久亚洲精品无码| 国产高清在线精品一区小说| 国产精品久久久久无码av| 精品国产第一国产综合精品| 在线涩涩免费观看国产精品| 欧美精品亚洲人成在线观看| 精品国产成人在线| 国产精品青草视频免费播放| 777久久精品一区二区三区无码| 99国产精品久久| 国产精品99久久精品| 国产精品人人爽人人做我的可爱 | 亚洲精品久久久www| 欧美精品一二区| 日韩精品欧美| 下载天堂国产AV成人无码精品网站| 久久精品亚洲欧美日韩久久| 国产综合成人色产三级高清在线精品发布| 欧美日韩精品一区二区在线播放| 精品国产第1页|