目前本站已有 十几万 份求职资料啦!


java软件开发工程师笔试题

10-15 23:59:20 来源:http://www.qz26.com 笔试题目   阅读:8214
导读:{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);
java软件开发工程师笔试题,标签:银行笔试题目,企业笔试题目,http://www.qz26.com

  {

  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.qz26.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)

  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");

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


Tag:笔试题目银行笔试题目,企业笔试题目求职笔试面试 - 笔试题目
【字号: 】 【打印】 【关闭
最新更新
推荐热门
联系我们 | 网站地图 | 财务资料 | 范文大全 | 求职简历 | 财会考试 | 成功励志
Copyright 二六求职资料网 All Right Reserved.
1 2 3 4 5 6 7 8 9 10