當前位置:高考升學網 > 招聘筆試題 > 正文

新華信國際信息咨詢JAVA工程師筆試題和面試題答案(三)

更新:2023-09-18 13:10:37 高考升學網

  D.8

  8:

  String s=”Example String”;Which operation is not legal?

  String s=”Example String”;Which operation is not legal?

  A.int i=s.length();

  B.s[3]=”x”;

  C.String short_s=s.trim();

  D.String t=”root”+s;

  9:

  Give this class outline:

  class Example{

  private int x;

  //rest of class body…

  }

  Assuming that x invoked by the code java Example, which statement can made x be directly accessible in main() method of Example.java?

  Give this class outline:

  class Example{

  private int x;

  //rest of class body…

  }

  Assuming that x invoked by the code java Example, which statement can made x be directly accessible in main() method of Example.java?

  A.Change private int x to public int x

  B.change private int x to static int x

  C.Change private int x to protected int x

  D.change private int x to final int x

  10:

  What will happen when you attempt to compile and run the following code?

  class Base

  {

  int i = 99;

  public void amethod()

  {

  System.out.println("Base.amethod()");

  }

  Base()

  {

  amethod();

  }

  }

  public class Derived extends Base

  {

  int i = -1;

  public static void main(String argv[])

  {

  Base b = new Derived();

  System.out.println(b.i);

  b.amethod();

  }

  public void amethod()

  {

  System.out.println("Derived.amethod()");

  }

  }

  Choices:

  What will happen when you attempt to compile and run the following code?

  class Base

  {

  int i = 99;

  public void amethod()

  {

  System.out.println("Base.amethod()");

  }

  Base()

  {

  amethod();

  }

  }

  public class Derived extends Base

  {

  int i = -1;

  public static void main(String argv[])

  {

  Base b = new Derived();

  System.out.println(b.i);

  b.amethod();

  }

  public void amethod()

  {

  System.out.println("Derived.amethod()");

  }

  }

  Choices:

  A.Derived.amethod() -1 Derived.amethod()

  B.Derived.amethod() 99

  C.Compile time error

  D.Derived.amethod()

  11:

  What will be the result of executing the following code?

  // Filename; SuperclassX.java

  package packageX;

  public class SuperclassX

  {

  protected void superclassMethodX()

  {

  }

  int superclassVarX;

  }

  // Filename SubclassY.java

最新圖文

2020年河北新聞網兩學一做

時間:2023-09-18 07:0:24

2020年河北新聞網兩學一做

時間:2023-09-15 11:0:59

兩學一做學習教育知

時間:2023-09-21 06:0:30

2020年開展兩學一做學習教

時間:2023-09-19 21:0:30
9999久久久国产精品,日韩在线一区二区三区欧美,日韩精品综合在线人妻,免费AAAAAA毛片看
亚洲午夜福利一级无吗 | 亚洲大型AV一区二区三区 | 午夜精品在线直播的视频网站 | 亚洲日韩欧美第一区 | 日韩AV在线永久免费观看 | 亚洲精品国产综合一线久久 |