<dfn id="w48us"></dfn><ul id="w48us"></ul>
  • <ul id="w48us"></ul>
  • <del id="w48us"></del>
    <ul id="w48us"></ul>
  • 中興筆試題JSD1309

    時間:2023-02-10 00:49:10 筆試題目 我要投稿
    • 相關推薦

    2013中興筆試題JSD1309

      1. 下列代碼的運行結果是:

    2013中興筆試題JSD1309

      public class GoTest {

      public static void main(String[] args) {

      Sente a = new Sente();

      a.go();

      Goban b = new Goban();

      b.go();

      Stone c = new Stone();

      c.go();

      }

      }

      class Sente implements Go {

      public void go() {

      System.out.println(“go in Sente”);

      }

      }

      class Goban extends Sente {

      public void go() {

      System.out.println(“go in Goban”);

      }

      }

      class Stone extends Goban implements Go {

      }

      interface Go {

      public void go();

      }

      A. go in Goban

      go in Sente

      go in Sente

      B. go in Sente

      go in Sente

      go in Goban

      C. go in Sente

      go in Goban

      go in Goban

      D. go in Goban

      go in Goban

      go in Sente

      正確答案:C

      2. A類中有一個方法:protected int print(String str){},B類繼承A類,以下方法能在B類中重寫A類中print()方法的是: ()。

      A.

      public int print(String str){}

      B.

      private int print(String str){}

      C.

      private void print(String str){}

      D.

      public void print(String str){}

      正確答案:A

      3. List類的對象list中的元素為:[0, 1, 2, 3, 4, 5, 6, 7, 8, 9],現(xiàn)在想返回該list對象的子集合[5,6,7,8],需要做的操作是:

      A. list.subList(5, 8);

      B. list.subList(5, 9);

      C. list.subList(4, 8);

      D. list.subList(4, 9);

      正確答案:B

      4. 下列代碼的運行結果是:

      String test = “Test A. Test B. Test C.”;

      String regex = “\\.\\s*”;

      String[] result = test.split(regex);

      for (String s : result)

      System.out.print(s + ” “);

      A. Test A Test B Test C

      B. Test A. Test B. Test C.

      C. Test . Test . Test .

      D. A. B. C.

      正確答案:A

      5.

      運行下面的程序:

      int a = 100;

      int b = 200;

      a = a + b;

      b = a – b;

      a = a – b;

      System.out.println(“a=” + a + “, b=” + b);

      輸出的結果是:()。

      A. a=100, b=300

      B. a=100, b=200

      C. a=200, b=100

      D. a=300, b=200

      正確答案:C

      6.

      類A,B和C的定義如下:

      public class A {

      public void f() {

      System.out.println(“A.f()”);

      }

      }

      public class B extends A {

      public void f() {

      System.out.println(“B.f()”);

      }

      }

      public class C {

      public void g(A a) {

      System.out.println(“g(A a)”);

      a.f();

      }

      public void g(B b) {

      System.out.println(“g(B b)”);

      b.f();

      }

      }

      運行下面程序:

      C c = new C();

      A a = new B();

      c.g(a);

      輸出的結果是:()。

      A. g(A a)

      A.f()

      B. g(A a)

      B.f()

      C. g(B b)

      A.f()

      D. g(B b)

      B.f()

      正確答案:B

      7.

      下列代碼編譯和運行的結果是()

      public class Foo {

      public static void main(String[] args) {

      java.util.List list = new java.util.ArrayList();

      list.add(new B());

      list.add(new C());

      for (A a : list) {

      a.x();

      a.y();

      }

      }

      }

      interface A {

      void x();

      }

      class B implements A {

      public void x() {}

      public void y() {}

      }

      class C extends B {

      public void x() {}

      }

      A.

      代碼運行沒有輸出

      B.

      運行時拋出異常

      C.

      代碼a.y();行,編譯錯誤

      D.

      代碼java.util.List list = new java.util.ArrayList();行,編譯錯誤

      正確答案:C

      8.

      下列代碼的輸出結果是()。

      abstract class Vehicle {

      public int speed() {

      return 0;

      }

      }

      class Car extends Vehicle {

      public int speed() {

      return 60;

      }

      }

      class RaceCar extends Car {

      public int speed() {

      return 150;

      }

      }

      public class TestCar {

      public static void main(String[] args) {

      RaceCar racer = new RaceCar();

      Car car = new RaceCar();

      Vehicle vehicle = new RaceCar();

      System.out.println(racer.speed() + “, ” + car.speed() + “, ”

      + vehicle.speed());

      }

      }

      A.

      0, 0,0

      B.

      150, 60, 0

      C.

      150, 150, 150

      D.

      拋出運行時異常

      正確答案:C

      9. 下列數(shù)組聲明語句中,錯誤的是:()。

      A.

      int[] arr = new int[8];

      B.

      int[] arr = new int[8]{};

      C.

      int[] arr = {};

      D.

      int[] arr = new int[]{};

      正確答案:B

      10. 運行下列代碼:

      int[] oneArr = { 2, 11, 26, 27, 37, 44, 48, 60 };

      int[] twoArr = { 19, 35, 49, 55, 58, 75, 83, 84, 91, 93 };

      int[] threeArr = new int[oneArr.length + twoArr.length];

      int p = 0, q = 0;

      while (p < oneArr.length && q < twoArr.length) {

      threeArr[p + q] =

      oneArr[p] < twoArr[q] ? oneArr[p++] : twoArr[q++];

      }

      if (p < oneArr.length) {

      System.arraycopy(oneArr, p, threeArr, p + q, oneArr.length – p);

      }

      else if (q < twoArr.length) {

      System.arraycopy(twoArr, q, threeArr, p + q, twoArr.length – q);

      }

      System.out.println(Arrays.toString(threeArr));

      輸出的結果是:()。

      A. [2,11,26,27,37,44,48,60,19,35,49,55,58,75,83,84,91,93];

      B. [2,11,19,26,27,35,37,44,48,49,55,58,60,75,83,84,91,93];

      C. [19,35,49,55,58,75,83,84,91,93,2,11,26,27,37,44,48,60];

      D. [2,19,11,35,26,49,27,55,37,58,44,75,48,83,60,84,91,93];

      正確答案:B

      11.

      請看下列代碼:

      public static void main(String[] args) {

      <插入代碼>

      set.add(new Integer(2));

      set.add(new Integer(1));

      System.out.println(set);

      }

      如果想保證程序的輸出結果是[1,2],那么<插入代碼>處應填入的代碼是()。

      A.

      Set set = new TreeSet();

      B.

      Set set = new HashSet();

      C.

      Set set = new SortedSet();

      D.

      Set set = new LinkedHashSet();

      正確答案:A

      12.

      仔細分析下列代碼,請指出錯誤的行()。

      public class SomeThing{

      private String str;

      public int addOne(final int x){

      return ++x;

      }

      }

      A.

      public class SomeThing

      B.

      private String str;

      C.

      public int addOne(final int x)

      D.

      return ++x;

      正確答案:D

      13.

      下列代碼的輸出結果是()

      public static void main(String[] args) {

      String test = “a1b2c3″;

      String[] tokens = test.split(“\\d”);

      for (String s : tokens)

      System.out.print(s + ” “);

      }

      A.

      a b c

      B.

      1 2 3

      C.

      a1b2c3

      D.

      a1 b2 c3

      正確答案:A

      14. 請看下列代碼:

      class Payload {

      private int weight;

      public Payload(int wt) {

      weight = wt;

      }

      public Payload() {}

      public void setWeight(int w) {

      weight = w;

      }

      public String toString() {

      return Integer.toString(weight);

      }

      }

      public class TestPayload {

      static void changePayload(Payload p) {

      <插入代碼>

      }

      public static void main(String[] args) {

      Payload p = new Payload();

      p.setWeight(1024);

      changePayload(p);

      System.out.println(“The value of p is ” + p);

      }

      }

      假設運行后輸出“The value of p is 420”,那么<插入代碼>處應填入代碼是:

      A. p.setWeight(420);

      B. Payload.setWeight(420);

      C. p = new Payload(420);

      D. p = new Payload();

      p.setWeight(420);

      正確答案:A

      15. 下列代碼的輸出結果是:

      String str1 = “WhatisJava”;

      String str2 = “WhatisJava”;

      System.out.print(str1.equals( str2));

      System.out.print(“,”);

      String str3 = new String(“WhatisJava”);

      System.out.println(str1.equals(str3));

      A. true,false

      B. false,false

      C. false,true

      D. true,true

      正確答案:D

      16. 下列代碼的輸出結果是:

      public class Yikes {

      public static void go(Long n) {

      System.out.println(“Long “);

      }

      public static void go(Short n) {

      System.out.println(“Short “);

      }

      public static void go(int n) {

      System.out.println(“int “);

      }

      public static void main(String[] args) {

      short y = 6;

      long z = 7;

      go(y);

      go(z);

      }

      }

      A. Long

      Long

      B. Short

      Long

      C. int

      Long

      D. int

      int

      正確答案:C

      17. 下列代碼的輸出結果是:

      class Cup {

      }

      class PoisonCup extends Cup {

      public void takeCup(Cup c) {

      if (c instanceof PoisonCup) {

      System.out.println(“Inconceivable!”);

      } else if (c instanceof Cup) {

      System.out.println(“Dizzying intellect!”);

      } else {

      System.exit(0);

      }

      }

      }

      public class TestCup {

      public static void main(String[] args) {

      Cup cup = new PoisonCup();

      PoisonCup poison=new PoisonCup();

      poison.takeCup(cup);

      }

      }

      A. Inconceivable!

      B. Dizzying intellect!

      C. 代碼正常運行,但是無輸出

      D. 拋出運行時異常

      正確答案:A

      18.

      有變量聲明如下:

      short b = 120;

      下列語句中,錯誤的是()。

      A.

      short s = b;

      B.

      int i = b;

      C.

      byte s1 = b;

      D.

      long l = b;

      正確答案:C

      19. 下列關于IDE開發(fā)環(huán)境Eclipse,說法錯誤的是:()。

      A. Eclipse可以通過插件(plugin)的方式擴展其功能。

      B. Eclipse聯(lián)盟是由IBM公司捐資組建的。

      C. Eclipse使用了SWT圖形界面技術。

      D. Eclipse的運行不需要有JRE的支持。

      正確答案:D

      20. 下列選項中的類,能正確實現(xiàn)java.lang.Runnable接口和java.lang.Clonable接口的是()。

      A.

      public class Session implements Runnable, Clonable {

      public void run();

      public Object clone();

      }

      B.

      public class Session implements Runnable, implements Clonable {

      public void run() { / do something */ }

      public Object clone() { / make a copy */ }

      }

      C.

      public class Session implements Runnable, Clonable {

      public void run() { / do something */ }

      public Object clone() { /* make a copy */ }

      }

      D.

      public class Session extends Runnable, Clonable {

      public void run() ;

      public Object clone();

      }

      正確答案:C

      21. 下面關于final說法正確的是:()。

      A.

      final修飾類時,該類能被繼承。

      B.

      final修飾方法時,該方法能被重寫。

      C.

      當使用static final 修飾的常量時,將采用編譯期綁定的方式。

      D.

      當使用final和abstract共同修飾一個類時,final應至于abstract之前。

      正確答案:C

      22.

      下列代碼的輸出結果是()。

      public static void main(String[] args) {

      int[] one=new int[]{4,6,8};

      int[] two=new int[]{1,3,5,7,9};

      System.arraycopy(one, 1, two, 2, 2);

      System.out.println(Arrays.toString(two));

      }

      A.

      [1, 3, 7, 4, 6]

      B.

      [1, 3, 5, 7, 8]

      C.

      [1, 3, 5, 6, 9]

      D.

      [1, 3, 6, 8, 9]

      正確答案:D

      23.

      下列代碼運行的結果是()。

      public class Base {

      public static final String FOO = “foo”;

      public static void main(String[] args) {

      Base b = new Base();

      Sub s = new Sub();

      System.out.print(Base.FOO);

      System.out.print(Sub.FOO);

      System.out.print(b.FOO);

      System.out.print(s.FOO);

      System.out.print(((Base) s).FOO);

      }

      }

      class Sub extends Base {

      public static final String FOO = “bar”;

      }

      A.

      foofoofoofoofoo

      B.

      foobarfoobarbar

      C.

      foobarfoofoofoo

      D.

      foobarfoobarfoo

      正確答案:D

      24. 下列不屬于Java運算符的是()。

      A.

      !=

      B.

      <>

      C.

      >>

      D.

      <<

      正確答案:B

      25.

      運行下列程序:

      String str = “**oracle***oracle*****oracle***”;

      String str1 = “oracle”;

      int index = 0;

      while ((index = str.indexOf(str1, index)) != -1) {

      System.out.print(index+””);

      index += str1.length();

      }

      控制臺輸出的結果是:()。

      A.

      1 10 21

      B.

      2 11 22

      C.

      3 13 23

      D.

      5 13 22

      正確答案:B

      26. 下列表達式中,可以得到精確結果的是()。

      A. double d1 = 3.0 – 2.6;

      B. double d4 = 2.5 * 1.5;

      C. double d2 = 30/300;

      D. double d3 = 1/2 + 0.5;

      正確答案:B

      27. 請看下列代碼:

      interface Foo {

      int bar();

      }

      public class Sprite {

      public int fubar(Foo foo) {

      return foo.bar();

      }

      public void testFoo() {

      fubar(

      <插入代碼>

      );

      }

      }

      使類Sprite編譯通過,在<插入代碼>處應填入的代碼是:

      A. Foo { public int bar() { return 1; } }

      B. new Foo { public int bar() { return 1; } }

      C. new Foo() { public int bar(){return 1; } }

      D. new class Foo { public int bar() { return 1; } }

      正確答案:C

      28. 運行下面的程序:

      Calendar c = Calendar.getInstance();

      c.set(Calendar.YEAR, 2012);

      c.set(Calendar.MONTH, Calendar.SEPTEMBER);

      c.set(Calendar.DATE, 31);

      SimpleDateFormat sdf = new SimpleDateFormat(“yyyy-MM-dd”);

      System.out.println(sdf.format(c.getTime()));

      輸出的結果是:()。

      A. 2012-10-1

      B. 2012-10-01

      C. 2012-09-30

      D. 2012-9-30

      正確答案:B

      29.

      編譯和運行以下代碼的結果為()。

      public class MyMain{

      public static void main(String argv){

      System.out.println(“Hello cruel world”);

      }

      }

      A.

      編譯錯誤

      B.

      運行輸出 “Hello cruel world”

      C.

      編譯無錯,但運行時指示沒有定義構造方法

      D.

      編譯無錯,但運行時指示沒有正確定義main方法

      正確答案:D

      30.

      運行下面程序:

      public class Foo {

      public static void main(String[] args) {

      StringBuffer a=new StringBuffer(“A”);

      StringBuffer b=new StringBuffer(“B”);

      operator(a,b);

      System.out.println(a+”,”+b);

      }

      public static void operator(StringBuffer x,StringBuffer y){

      x.append(y);

      y=x;

      }

      }

      輸出的結果是:()。

      A.

      A,B

      B.

      A,A

      C.

      B,B

      D.

      AB,B

      正確答案:D

      31.

      分析如下代碼,輸出結果為()。

      public static void main(String[] args) {

      int i = 0;

      boolean re = false;

      re = ((++i) + i == 2) ? true : false;

      System.out.println(“i=” + i + “,re=”+re);

      }

      A.

      i=1,re=true

      B.

      i=0,re=true

      C.

      i=1,re=false

      D.

      i=0,re=false

      正確答案:A

      32. 數(shù)據(jù)類型int、char和double所占用內存字節(jié)數(shù)分別是:()。

      A. 4、2和8

      B. 2、2和4

      C. 2、1和8

      D. 4、4和4

      正確答案:A

      33.

      下列代碼的輸出結果是:()。

      public class StaticFoo {

      int num;

      static int x;

      public static void main(String[] args) {

      StaticFoo foo1 = new StaticFoo ();

      foo1.num++;

      foo1.x++;

      StaticFoo foo2 = new StaticFoo ();

      foo2.num++;

      foo2.x++;

      StaticFoo foo3 = new StaticFoo ();

      foo3.num++;

      foo3.x++;

      StaticFoo.x++;

      System.out.print(foo3.num+”,”);

      System.out.println(foo3.x);

      }

      }

      A.

      3,3

      B.

      1,3

      C.

      3,4

      D.

      1,4

      正確答案:D

      34. 下列代碼的運行結果是:

      public class WrappedString {

      private String s;

      public WrappedString(String s) {

      this.s = s;

      }

      public static void main(String[] args) {

      HashSet hs = new HashSet();

      WrappedString ws1 = new WrappedString(“aardvark”);

      WrappedString ws2 = new WrappedString(“aardvark”);

      String s1 = new String(“aardvark”);

      String s2 = new String(“aardvark”);

      hs.add(ws1);

      hs.add(ws2);

      hs.add(s1);

      hs.add(s2);

      System.out.println(hs.size());

      }

      }

      A. 1

      B. 2

      C. 3

      D. 4

      正確答案:C

      35. 下列選項中,不能包含重復元素的容器是:()。

      A.

      List

      B.

      ArrayList

      C.

      Set

      D.

      Collection

      正確答案:C

      36. 請看下列代碼:

      public abstract class Shape {

      int x;

      int y;

      public abstract void draw();

      public void setAnchor(int x, int y) {

      this.x = x;

      this.y = y;

      }

      }

      下列選項中能正確使用Shape類的是:

      A. public class Circle implements Shape {

      private int radius;

      }

      B. public abstract class Circle extends Shape {

      private int radius;

      }

      C. public class Circle extends Shape {

      private int radius;

      public void draw();

      }

      D. public class Circle extends Shape {

      private int radius;

      public void draw() {/* code here */}

      }

      正確答案:BD

      37. 下面的方法屬于StringBuffer的是:()。

      A. size

      B. insert

      C. delete

      D. length

      正確答案:BCD

      38. 已知類Foo的定義如下:

      public class Foo {

      int value;

      Foo(int value) {

      this.value = value;

      }

      public boolean equals(Object obj) {

      if (obj instanceof Foo) {

      Foo foo = (Foo) obj;

      return value == foo.value;

      } else {

      return false;

      }

      }

      運行下面程序段:

      ArrayList list = new ArrayList();

      HashSet set = new HashSet();

      list.add(new Foo(1));

      set.add(new Foo(1));

      System.out.println(《插入代碼》);

      如果控制臺輸出的結果是true,false,那么《插入代碼》處應填入的代碼是:

      A. list.contains(new Foo(1)) + “,”+ set.contains(new Foo(1))

      B. set.contains(new Foo(1)) + “,”+ list.contains(new Foo(1))

      C. new Foo(1).equals (new Foo(1)) + “,”+ list.contains(new Foo(1))

      D. new Foo(1).equals (new Foo(1)) + “,”+ set.contains(new Foo(1))

      正確答案:AD

      39.

      查看如下代碼:

      class A {

      protected int method (int a, int b) {

      return 0;

      }

      }

      下列選項中,可以在 A 的子類中使用的是()。

      A. public int method (int a, int b) { return 0; }

      B. private int method(int a, int b) { return 0; }

      C. private int method(int a, long b) { return 0; }

      D. public short method(int a, int b) { return 0; }

      正確答案:AC

      40. 下列邏輯表達式,值為false的是()。

      A. “abc,,,bcd,,def,efg,,”.split(“[,]+”).length == 4;

      B. “1st456″.matches(“\\d[a-z&&[^et]]{2,8}[0-9]+”);

      C. “abcdefghijklmnopqrstuvwxyz”.substring(5,26).length() == 20;

      D. “whatisjava”.equals(null);

      正確答案:BCD

      41.

      歌德巴赫猜想的近似證明

      歌德巴赫猜想是說任何一個大于2的偶數(shù)都能表示為兩個素數(shù)之和,請編寫一個Java程序,驗證1~100內歌德巴赫猜想的正確性。

      public class Guess {

      public static void main(String[] args) {

      System.out.println(“在1~100范圍內,現(xiàn)在開始證實哥德巴赫猜想:”);

      if (testifyGuess(1, 100)) {

      System.out.println(“在 1~100范圍內,哥德巴赫猜想是正確的。”);

      } else {

      System.out.println(“哥德巴赫猜想是錯誤的”);

      }

      }

      /**

      * 判斷1~100范圍內的所有偶數(shù)是否符合哥德巴赫猜想,符合則返回true,反之則返回false

      */

      public static boolean testifyGuess(int low, int high) {

      int i, j = 0;

      boolean flag = true;

      for (i = low; i <= high; i++)

      if ( 空白處1 ) // 在1~100之間選取大于2的偶數(shù)進行哥德巴赫猜想測試

      if (isGoldbach(i)) {

      j++; // j用來控制輸出格式 ,每行輸出5個數(shù)據(jù)

      if (j == 5) {

      System.out.println();

      j = 0;

      }

      } else {

      flag = false;

      break;

      }

      return flag;

      }

      /**

      *判斷參數(shù)a是否符合哥德巴赫猜想

      */

      public static boolean isGoldbach(int a) {

      int i;

      boolean flag = false;

      for (i = 1; 空白處2 ; i++) {

      // 根據(jù)試題分析中的表達式,傳入相關的兩個參數(shù)

      if ( 空白處3 ) {

      flag = true;

      System.out.print(a + “=” + i + “+” + (a – i) + ” “);

      空白處4

      }

      }

      return flag;

      }

      /**

      * 判斷參數(shù)i是否是素數(shù),是則返回true反之則返回false

      */

      public static boolean isPrime(int i) {

      int n;

      boolean flag = true;

      // 1本身不是素數(shù),因此需把這個特殊的數(shù)字拋出

      if (1 == i)

      flag = false;

      /*

      * 質數(shù)又稱素數(shù)。指在一個大于1的自然數(shù)中,除了1和此整數(shù)自身外,不能被其他自然數(shù)整除數(shù)

      * 判斷i是否是素數(shù)的一個方法是看2~i-1之間有其因子(能被2整除),

      * 有則不是素數(shù)返回false,反之則返回true

      */

      for ( 空白處5 )

      if (i % n == 0) {

      flag = false;

      break;

      }

      return flag;

      }

      }

      (1).

      下列選項中,能填入空白處1的代碼是( )

      A.

      i % 2 == 0 && i > 2

      B.

      i % 2 == 0 && i < 2

      C.

      i / 2 == 0 && i > 2

      D.

      i / 2 == 0 && i < 2

      正確答案:A

      (2).

      下列選項中,能填入空白處2的代碼是( )

      A.

      i <= a % i;

      B.

      i <= a / i;

      C.

      i <= a % 2;

      D.

      i <= a / 2;

      正確答案:D

      (3).

      下列選項中,能填入空白處3的代碼是( )

      A.

      isPrime(i-1) && isPrime(a – i)

      B.

      isPrime(i) && isPrime(a + i)

      C.

      isPrime(i) && isPrime(a – i)

      D.

      isPrime(i) && isPrime(a)

      正確答案:C

      (4).

      下列選項中,能填入空白處4的代碼是( )

      A.

      final;

      B.

      break;

      C.

      continue;

      D.

      static;

      正確答案:B

      (5).

      下列選項中,能填入空白處5的代碼是( )

      A.

      n = 2; n <= i – 1; n++

      B.

      n = 2; n <= i; n++

      C.

      n = 1; n <= i – 1; n++

      D.

      n = 1; n <= i; n++

      正確答案:A

      42.

      閱讀理解

      public class A {

      public A() {

      System.out.print(“A “);

      }

      public A(String s) {

      System.out.print(s);

      }

      public void fun() {

      System.out.println(“A.fun()”);

      }

      }

      public class B extends A {

      public B() {

      System.out.print(“B “);

      }

      public B(String s) {

      super(s);

      }

      public void fun() {

      System.out.println(“B.fun()”);

      }

      public void sun(){

      System.out.println(“B.sun()”);

      }

      public static void Main() {

      A a = new B();

      a.fun();

      }

      }

      (1).

      下列關于上述代碼中構造方法的描述,錯誤的是()。

      A.

      實例化對象 a 時,將默認調用父類的無參構造方法

      B.

      類 B中使用 super 關鍵字,是為了調用父類的含有一個參數(shù)的構造方法

      C.

      實例化對象 a 時,父類A和子類B的構造方法都會被調用到

      D.

      實例化父類對象時,調用父類 A 的構造方法;實例化子類對象時,則只調用子類B的構造方法

      正確答案:D

      (2).

      該代碼運行后,輸出為:()。

      A.

      A B A.fun()

      B.

      A B B.fun()

      C.

      B A A.fun()

      D.

      B A B.fun()

      正確答案:B

      (3).

      如果 main 方法中如此調用:

      public static void main(String[] args)

      {

      A a = new B(“Hello,”);

      a.fun();

      }

      其他代碼不變,該代碼運行后,輸出為:()。

      A.

      A A.fun()

      B.

      B A.fun()

      C.

      Hello,A.fun()

      D.

      Hello,B.fun()

      正確答案:D

      (4).

      如果 main 方法中如此調用:

      public static void main(String[] args)

      {

      A a = new A();

      a.sun();

      }

      其它代碼不變,下列說法正確的是:()。

      A.

      運行輸出結果為:A B.sun()

      B.

      運行輸出結果為:A B B.sun()

      C.

      運行輸出結果為:B A B.sun()

      D.

      編譯錯誤

      正確答案:D

      (5).

      下列關于上述代碼的描述,正確的是()。

      A.

      如果將A類定義成public abstract class A,那么方法fun必須定義成抽象方法

      B.

      如果將A類定義成public abstract class A,那么A類中必須有一個抽象方法

      C.

      如果將A類中的方法fun定義成public abstract void fun(),那么A類必須是抽象類

      D.

      如果將A類定義成public abstract class A,那么A類應然可以實例化對象

      正確答案:C

     

     

    【中興筆試題JSD1309】相關文章:

    中興2015筆試題08-02

    中興筆試題08-18

    中興硬件筆試試題07-31

    中興通訊南京筆試題07-31

    中興公共部分筆試題07-31

    中興天津軟件筆試題08-10

    中興人力資源筆試題08-02

    中興筆試題及分析目分享07-31

    中興2016年校招筆試題08-16

    主站蜘蛛池模板: 精品久久久久久久久久久久久久久| 欧美XXXX黑人又粗又长精品| 免费人成在线观看欧美精品| 国产精品无码久久综合| 四虎精品成人免费视频| 国产精品v欧美精品v日本精| 国产精品福利网站导航| 蜜国产精品jk白丝AV网站| 精品久久777| 无码精品久久久久久人妻中字| 国产内地精品毛片视频| 99精品人妻少妇一区二区| 国产精品久久久久影院色| 国产麻豆一精品一AV一免费| 中文字幕久精品免费视频| 欧美精品区一级片免费播放| 国产精品综合专区中文字幕免费播放 | 国产成人精品一区在线| 国产福利视精品永久免费| 国产一精品一AV一免费| 少妇精品久久久一区二区三区 | 国产成人亚洲精品91专区手机 | 2022精品国偷自产免费观看| 久久青草国产精品一区| 精品亚洲综合久久中文字幕| 69堂国产成人精品视频不卡| 国产精品无套内射迪丽热巴| 国产一精品一AV一免费| 囯产精品一品二区三区| 99在线精品免费视频九九视| 国产精品无码一区二区三级 | 精品少妇一区二区三区在线| 精品福利一区二区三区精品国产第一国产综合精品 | 日本午夜精品理论片A级APP发布| 精品久久久久国产免费| 久久国产精品无码网站| 久久综合精品国产一区二区三区| 久久久国产精品| 亚洲午夜精品久久久久久app| 国产精品无码无卡在线播放| 精品人无码一区二区三区|