三九宝宝网宝宝教育学龄段教育

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

11月05日 编辑 39baobao.com

[2008年宏观经济政策与发展规划模拟题一]一、单项选择题 1、企业债券的利率不得高于银行同期居民储蓄定期存款利率的( )。 A、35% B、40% C、45% D、30% 2、在进行工业结构优化时,要立足已有的工业基础,通过“扶优、关...+阅读

续:Ja程序员认证模拟题及详细分析(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 ponent has a fill value of BOTH, then as the container change size, the ponent is resized.

D. Every ponent 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 ponent.

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 ponent 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.

ja 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 ja

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 73.What might cause the current thread to stop executing?

A. An interrupted exception is thrown.

B. The thread execute a sleep() call.

C. The thread constructs a new thread

D. A thread of higher priority bees ready

E. The thread executes a read() call on InputStream

74.Which statements are true about threads?

A. Threads created from the same class all finish together.

B. A thread can be created only by subclassing ja.lang.Thread.

C. Invoking the suspend() method stops a thread so that it cannot be restarted.

D. The Ja 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 bined declaration and instantiation?

A. private class C

B. new SimpleInterface(){

C. new plexInterface(x){

D. private final abstract class(

E. new plexClass() 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 Ja objects.

====================================================

答案及详细分析:

66.D

main()方法是静态方法,静态方法不能直接访问非静态成员。

67.D

此题考察学生对内部类属性的掌握情况。内部类可以实现接口;匿名类是内部类的一种;内部类通过各种方式可以在包含它的类的外部被访问到;内部类被定义在块中时,只能访问包含它的块的final类型变量。故选择D。

68.C

此题考察考生对类GridBagLayout、及类GridBagConstraints的掌握情况,请考生查阅API文档。

69.B、C

此题考察考生对事件处理的理解。D选项是错的,因为控件可以监听自己的事件。另外,当实现一个接口时,必须实现它内部的所有的方法,所以E选项也是错的。

70.A

命令行参数是紧跟在类名后面的。所以本题中参数由“cat”提供。

71.E

在完全封装类中,一般的定义方式是将所有的成员变量定义为“private”,而将访问这些变量的方法定义为非“private”类型,这样可以在类的外部间接地访问这些变量。所以E选项是最符合这个意思的。

72.B

此题考察“Collection API”的一些知识。实现接口“Set”的类内部所存储的对象是没有顺序,但是允许重复的。另请注意其它几个接口的特征。

73.A、B、D、E

当新线程被创建时,只是使它变为可运行状态而已,并不能使当前线程停止执行。当调用read()方法时,它与输入输出打交道,可能造成线程的暂停执行。

74.D、E

程序的执行完毕是以用户线程(user threads)的结束而标志结束的,与超级线程(daemon threads)无关。所以D选项是对的。E选项说明的是当不同线程对相同数据进行访问时,可能造成数据毁损。

75.A、B

76.B、D

程序的代码是无法对垃圾回收进行精确控制的,程序代码与垃圾回收是相互独立的系统,并不互相影响。答案D告诉我们程序员可以使一个本地变量失去任何意义,例如给本地变量赋值为“null”;

以下为关联文档:

小学毕业水平测试模拟题小学毕业水平测试模拟题 一、汉语拼音 1、给下面的词语选择正确的读音,在正确读者下画横线。厌恶 (ě wù) 调查(diào tiáo) 影片(piān piàn)切菜(qiè qiē) 苦难(nán nàn) 理发...

2008年宏观经济政策与发展规划模拟题2 1、允许纳税人在计算增值税时从计税依据中扣除外购固定资产折旧部分的是( )。 A、消费型增值税 B、收入型增值税 C、生产型增值税 D、所得课税 2 2、对投资总量的宏观调控主...

项目决策分析与评价模拟题二、多项选择题(共35题。每题2分。每题的备选项中。有2个或2个以上符合题意,至少有1个错项。错选,本题不得分;少选,所选的每个选项得0.5分) 61.下列关于项目评估阶段的表述,正确...

小学六年级语文模拟题试题一、看拼音写词语。10分 bào yuàn dǐ yù qīnɡ miè shū jí ( ) ( ) ( ) ( ) miǎn lí kuí wú chéng fá zào xíng ( ) ( ) ( ) ( ) 二、用“精”组成恰当的词语填在( )里。5分...

2008年宏观经济政策与发展规划模拟题11、国内总供给的统计核算指标是以( )计算的国内生产总值。 A、分配法 B、消费法 C、收入法 D、生产法 12、在发达的市场经济国家,政府把投资( )。 A、不作为直接调控的对象 B、...

项目决策分析与评价模拟题一、单项选择题(共60题,每题1分。每题的备先项中,只有1个最符合题意) 1. 由于决策分析与评价是个动态过程,在实施中要注意新情况的出现,要及时、全面、准确地获取新的信息,必要时要...

小学六年制毕业考试模拟题一、选择题。(将正确答案的一个序号填在括号里,每题2分,共20分) 1.下面的几组词,带点字读音完全一样的一组是( )A 峰峦 难处 喃喃 阻拦 波澜壮阔B 剥皮 波动 传播 颠簸 拨乱反正C 大...

小学六年级英语下册模拟题六、选出每组中不同类的那个单词。(5分) ( )1. A. happy B. rainy C. windy ( )2. A. tomorrow B. tomato C. today ( )3. A. first B. three C. ninth ( )4. A. fat B. bette...

20122013年新标准小学英语三年级期末模拟题一、圈出你听到的选项。 1. cat cap 2. dog bag 3. pen pencil 4. four five 5. boy girl 6. desk chair 7. book look 8. black blue 9. nose nurse 10.head hand 二、听音...

推荐阅读
图文推荐