Java认证考试 题目列表
类的可访问性不影响类成员的可访问性

程序员已经创建了一个类,该类的实例可以用做Hashtable 的键(key)。哪两项是对的?()    A、该类有一个返回类型为 int 的 equals 方法。B、该类有一个返回类型为 boolean 的 equals 方法。C、该类有一个接收一个参数的 equals 方法。D、该类有一个接收两个参数的 equals 方法。

You want a class to have access to members of another class in the same package. Which is the most restrictive access modifier that will accomplish that will accomplish this objective?()A、 PublicB、 PrivateC、 ProtectedD、 TransientE、 No access modifier is required.

You are assigned the task of building a panel containing a TextArea at the top, a label directly below it,and a button directly below the label. If the three components are added directly to the panel. Which layout manager can the panel use to ensure that the TextArea absorbs all of the free vertical space when  the panel is resized?()A、 GridLayout.B、 CardLayout.C、 FlowLayout.D、 BorderLayout.E、 GridBagLayout.

1. interface A { public void aMethod(); }  2. interface B { public void bMethod(); }  3. interface C extends A,B { public void cMethod(); }  4. class D implements B {  5. public void bMethod() { }  6. }  7. class E extends D implements C {  8. public void aMethod() { }  9. public void bMethod() { }  10. public void cMethod() { }  11. }  What is the result?() A、 Compilation fails because of an error in line 3.B、 Compilation fails because of an error in line 7.C、 Compilation fails because of an error in line 9.D、 If you define D e = new E(), then e.bMethod() invokes the version of bMethod()defined in Line 5.E、 If you define D e = (D)(new E()),then e.bMethod() invokes the version of bMethod() defined in Line 5.F、 If you define D e = (D)(new E()), then e.bMethod() invokes the version of bMethod() defined in Line 9.

Which two are characteristics of the Transfer Object design pattern?()A、It reduces network traffic by collapsing multiple remote requests into one.B、It increases the complexity of the remote interface by removing coarse-grained methods.C、It increases the complexity of the design due to remote synchronization and version control issues.D、It increases network performance introducing multiple fine-grained remote requests which return verysmall amounts of data.

数组的长度可以通过以下哪个属性或方法得到?()  A、sizeB、lengthC、getSize()D、getLength()

输入流与输出流各有什么方法?

程序员想要创建一个名为MyThread的类以便在main方法中用Thread实例化。对于下面三行:  MyThread必须继承Thread。  MyThread必须实现Thread。  MyThread必须覆盖public void run()。    有几行是正确的?()  A、 0B、 1C、 2D、 3

现有:  class Output  {  public static void main (String[]  args)    {      int i=5:  System.out.print( "4"+i+"");      System.out.print (i+5+"7");     System.out.println  (i+"8");      }      }      结果为:()     A、  99722B、  955758C、  4510758D、  459722

Which of the following statements are legal?()         A、 long l = 4990;B、 int i = 4L;C、 float f = 1.1;D、 double d = 34.4;E、 double t = 0.9F;

现有:t是一个合法的Thread对象的引用,并且t的合法run()方法如下:  public void run()  {  System.out.print ("go");      }      及:  t.start();      t.start();      t.run();      哪一个是结果?()    A、go goB、go go goC、go之后跟着一个异常D、go go之后跟着一个异常

Which method must be used to encode a URL passed as an argument to  HttpServletResponse.sendRedirect when using URL rewriting for session tracking?()A、 ServletResponse.encodeURLB、 HttpServletResponse.encodeURLC、 ServletResponse.encodeRedirectURLD、 HttpServletResponse.encodeRedirectURL

Assume the custom tag my:errorProne always throws a java.lang.RuntimeException with the message "Filenot found." An error page has been configured for this JSP page. Which option prevents the exceptionthrown by my:errorProne from invoking the error page mechanism, and outputs the message "File notfound" in the response?()A、c:try catch="ex"my:errorProne //c:try${ex.message}B、c:catch var="ex"my:errorProne //c:catch${ex.message}C、c:try. my:errorProne /. /c:try. c:catch var="ex" /. ${ex.message}D、c:try. my:errorProne /. c:catch var="ex" /. ${ex.message}. /c:try

下载并安装JDK软件包,并尝试查看其中的JDK文档。