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

Java工程師筆試題和面試題答案(三)

更新:2023-09-15 22:01:53 高考升學網

  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;//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:

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

  public class Static

  {

  static

  {

  int 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:

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

  public class Static

  {

  static

  {

  int 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 : 2

  B.prints : 3

  C.prints : 7

  D.prints : 8

  13:假定a和b為int型變量,則執行下述語句組后,b的值為

  a=1;

  b=10;

  do

  {

  b-=a;

  a++;

  } while (b--<0);

  A.9

  B.-2

  C.-1

  D.8

  14:設有變量說明語句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;

最新圖文

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毛片看
中字幕久久国产精品免费 | 在线精品亚洲一区二区 | 正在播放约酒店少妇高潮 | 一级a爱片国产亚洲精品 | 中文字幕乱码2国语自产 | 色偷偷888欧美精品久久久 |