Java认证考试 题目列表
现有   1. class Calc {  2.  public static void main(String [] args) {   3.    try {  4.         int x = Integer.parselnt ("42a") ;   5.     //insert code here  6.         System.out.print ("oops");   7.    }   8.   }   9. }   下面哪两行分别插入到第五行,会导致输 "oops" ? () A、 } catch (IllegalArgumentException e) {B、 } catch (IllegalStateException c) {C、 } catch (NumbelFormatException n) {D、 } catch (ClassCastException c) {

class Thread2 implements Runnable {  void run() {  System.out.print("go ");  }  public static void main(String [] args) {  Thread2 t2 = new Thread2();  Thread t = new Thread(t2);  t.start();  }  }   结果为()A、goB、编译失败C、代码运行,无输出结果D、运行时异常被抛出

List接口的特点是哪项?()A、不允许重复元素,元素有顺序B、不允许重复元素,元素无顺序C、允许重复元素,元素有顺序D、允许重复元素,元素无顺序

You want to create a valid directory structure for your Java EE web application, and you want to put yourweb application into a WAR file called MyApp.war. Which two are true about the WAR file?()A、At deploy time, Java EE containers add a directory called META-INF directly into the MyApp directory.B、At deploy time, Java EE containers add a file called MANIFEST.MF directly into the MyApp directory.C、It can instruct your Java EE container to verify, at deploy time, whether you have properly configured your application’s classes.D、At deploy time, Java EE containers add a directory call META-WAR directly into the MyApp directory.

面板缺省搭配是什么布局管理器?() A、边界布局管理器B、盒式布局管理器C、表格型布局管理器D、流式布局管理器

int x = 3;  int y = 1;  if (x = y) {  System.out.println(“x = “ + x);  }  What is the result? ()A、x=1B、x=3C、Compilationensp;fails.D、Theensp;codeensp;runsensp;withensp;noensp;output.ensp;E、Anensp;exceptionensp;isensp;thrownensp;atensp;runtime.

In the Java API documentation which sections are included in a class document?()    A、 The description of the class and its purposeB、 A list of methods in its super classC、 A list of member variableD、 The class hierarchy

Java可以设置程序的界面外观,即可以让程序在不同操作系统下按照系统特有的外观风格显示,也可以将风格统一。

如果源文件中包含public类,源文件的文件名必须与类名相同

Given that a static method doIt() in a class Work represents work to be done, what block of code will succeed in starting a new thread that will do the work?   CODE BLOCK a:   Runnable r = new Runnable() {   public void run() {   Work.doIt();   }   };   Thread t = new Thread(r);   t.start();   CODE BLOCK b:   Thread t = new Thread() {  public void start() {   Work.doIt();  }  };   t.start();   CODE BLOCK c:   Runnable r = new Runnable() {   public void run() {   Work.doIt();   }   };   r.start();  CODE BLOCK d:   Thread t = new Thread(new Work());   t.start();   CODE BLOCK e:   Runnable t = new Runnable() {   public void run() {   Work.doIt();   }   };   t.run();  A、Code block a.B、Code block B.C、Code block c.D、Code block d.E、Code block e.

关闭框架时,缺省地也会关闭整个应用程序。

1. public class Blip {  2. protected int blipvert(int x) { return 0; }  3. }  4. class Vert extends Blip {  5. // insert code here  6. }  Which five methods, inserted independently at line 5, will compile?()  A、 public int blipvert(int x) { return 0; }B、 private int blipvert(int x) { return 0; }C、 private int blipvert(long x) { return 0; }D、 protected long blipvert(int x, int y) { return 0; }E、 protected int blipvert(long x) { return 0; }F、 protected long blipvert(long x) { return 0; }G、protected long blipvert(int x) { return 0; }

Which method is an appropriate way to determine the cosine of 42 degrees?()  A、 Double d = Math.cos(42);B、 Double d = Math.cosine(42);C、 Double d = Math.cos(Math.toRadians(42));D、 Double d = Math.cos(Math.toDegrees(42));E、 Double d = Math.cosine(Math.toRadians(42));

下列哪些项是泛型的优点?()     A、不用向下强制类型转换B、代码容易编写C、类型安全D、运行速度快

程序:  class MyDate{   private int year; private int month; private int day;  public MyDate(int year,int month,int day){  this.year=year;  this.month=month;      this.day=day; }  //Override Method }  为了让new MyDate(1980,11,9)==new MyDate(1980,11,9) 返回true,必须在Override Method处覆盖哪个方法?() A、 hashCodeB、 equalsC、 toStringD、 notify