当前位置:七七学习网文档大全求职指南求职笔试面试笔试题目java软件开发工程师笔试题» 正文

java软件开发工程师笔试题

[10-10 21:21:19]   来源:http://www.77xue.com  笔试题目   阅读:8666
概要:public class ThrowsDemo{static void throwMethod(){www.77xue.com哦 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.prin
java软件开发工程师笔试题,标签:驾照笔试题目,腾讯笔试题目,http://www.77xue.com

  public class ThrowsDemo

  {

  static void throwMethod()

  {

www.77xue.com哦

  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?

www.77xue.com哦

  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)

上一页  [1] [2] [3] [4]  下一页


Tag:笔试题目驾照笔试题目,腾讯笔试题目求职指南 - 求职笔试面试 - 笔试题目
联系我们 | 网站地图 | 范文大全 | 管理知识 | 教学教育 | 作文大全 | 语句好词
Copyright http://www.77xue.com--(七七学习网) All Right Reserved.
1 2 3 4 5 6 7 8 9 10