Java程序员认证模拟题及详细分析(4)

文章作者 100test 发表时间 2007:03:10 18:30:20
来源 100Test.Com百考试题网


续:Java程序员认证模拟题及详细分析(1) 和(2) (3)
   66. Given the following class outline:
   class Example{
   private int x.
   // rest of class body
   public static void main(String args[]){
   //implementation of main mehtod}
   }
   Which statement is true?
   A. x=2 is a valid assignment in the main() method of class Example.
   B. Changing private int x to int x would make x=2 a valid assignment in the main() method of class Example.
   C. Changing private int x to public int x would make x=2 a valid assignment in the main() method of class Example.
   D. Changing private int x to static int x would make x=2 a valid assignment in  the main() method of class Example.
   E. Changing class Example to public class Example would make x=2 a valid assignment in the main() method of class Example.

   67. Which statement is true about an inner class?
   A. It must be anonymous
   B. It can not implement an interface
   C. It is only accessible in the enclosing class
   D. It can access any final variables in any enclosing scope.

   68. Which statement is true about the grid bag layout manager?
   A. The number of rows and columns is fixed when the container is created.
   B. The number of rows and columns is fixed when the GridBagLayout object is created.
   C. If a component has a fill value of BOTH, then as the container change size, the component is resized.
D. Every component must carry a non-zero weightx and weighty value when it is added to the container
   E. If a row has a weighty value that is non-zero, then as the container changes height, the row changes height.

   69. Which statement are true about writing a class that is to handle the events issued by a user interface component.
   A. Subclassing an adapter is inappropriate in this case.
   B. The class should implement some listener interface
   C. A class can implement multiple listener interfaces if desired.
   D. A subclass of an AWT component cannot listen to its own events.
   E. When implements listener interface, a class need only provide those handler methods that it chooses.

   70.The argument for a class?s main() method is called args, and the class is invoked as follows.
java Example cat
   What would be the effect of trying to access args[0] in the main method?
   A. The value produced is cat
   B. The value produced is java
   C. The value produced is Example
   D. An object of type NullPointerException is thrown.
   E. An object of type ArrayIndexOutofBoundsException is thrown.
   71. Which best describes the requirements of a fully encapsulated class?
   A. Mehtods must not be private.
   B. Variables must not be public.
   C. The class must be marked final
   D. Public methods are all marked final.
   E. Modification of the objects state is only possible using method calls.

   72.Which contains objects without ordering, duplication, or any particular lookup/retrieval mechanism?
   A. Map
   B. Set
   C. List
   D. Collection
   E. Enumeration

相关文章


Java程序员认证模拟题及详细分析(3)
Java程序员认证模拟题及详细分析(4)
VB常用算法(十)字符处理(统计与加密)
澳大利亚华人论坛
考好网
日本华人论坛
华人移民留学论坛
英国华人论坛