|
same class all finish together. B. A thread can be created only by subclassing java.lang.Thread. C. Invoking the suspend() method stops a thread so that it cannot be restarted. D. The Java interpreter?s natural exit occurs when no non-daemon threads remain alive. E. Uncoordinated changes to shared data by multiple threads may result in the data being read, or left, in an inconsistent state.
75.What might form part of a correct inner class declaration or combined declaration and instantiation? A. private class C B. new SimpleInterface(){ C. new ComplexInterface(x){ D. private final abstract class( E. new ComplexClass() implements SimpleInterface 76. Which statements are true about the garbage collection mechanisms? A. The garbage collection mechanism release memory at pridictable times. B. A correct program must not depend upon the timing or order of garbage collection C. Garbage collection ensures that a program will NOT run out of memory during execution D. The programmer can indicate that a reference through a local variable is no longer going to be used. E. The programmer has a mechanism that explicitly and immediately frees the memory used by Java objects.
====================================================
答案及详细分析:
66.D main()方法是静态方法,静态方法不能直接访问非静态成员。 67.D 此题考察学生对内部类属性的掌握情况。内部类可以实现接口;匿名类是内部类的一种;内部类通过各种方式可以在包含它的类的外部被访问到;内部类被定义在块中时,只能访问包含它的块的final类型变量。故选择D。 68.C 此题考察考生对类GridBagLayout、及类GridBagConstraints的掌握情况,请考生查阅API文档。 69.B、C 此题考察考生对事件处理的理解。D选项是错的,因为控件可以监听自己的事件。另外,当实现一个接口时,必须实现它内部的所有的方法,所以E选项也是错的。 70.A 命令行参数是紧跟在类名后面的。所以本题中参数由“cat”提供。 71.E 在完全封装类中,一般的定义方式是将所有的成员变量定义为“priv上一页 [1] [2] [3] [4] 下一页 |
|
|
|
|
|
|
|