SCJP认证套题解析之一
来源:优易学  2010-1-11 11:39:28   【优易学:中国教育考试门户网】   资料下载   IT书店

 

A. BorderLayout
B. FlowLayout
C. CardLayout
D. GridLayout
(b)
题目:当Frame的大小被改变时Frame中的按钮的位置可能被改变时使用的哪一个布局管理器。
A:该布局管理器将容器划分为五个部分,容器大小的改变不会影响其中的组件的位置而是影响他们的大小。
B:该布局管理器根据放入其中的组件的最合适大小调整组件的位置,根据组件放入的顺序安排,一行不能容纳时放入下一行,因此容器的大小改变可能改变组件的位置。
C:该布局管理器显示放入该容器的当前页中的组件,一次显示一个,容器大小的改变不能影响其中组件的位置。
D:该布局管理器将容器划分为固定的网格,组件加入后占据一个单元,各组件的相对位置不会因为容器的大小变化而变化,改变的只是组件的大小。
 
7、Given the following code fragment:
     1) public void create() {
     2)   Vector myVect;
     3)   myVect = new Vector();          
     4) }
Which of the following statements are true?
A. The declaration on line 2 does not allocate memory space for the variable myVect.
B. The declaration on line 2 allocates memory space for a reference to a Vector object.
C. The statement on line 2 creates an object of class Vector.
D. The statement on line 3 creates an object of class Vector.
E. The statement on line 3 allocates memory space for an object of class Vector
(ade)
题目:给出下面的代码片断。。。下面的哪些陈述为true(真)?
A.      第二行的声明不会为变量myVect分配内存空间。
B.      第二行的声明分配一个到Vector对象的引用的内存空间。
C.      第二行语句创建一个Vector类对象。
D.     第三行语句创建一个Vector类对象。
E.      第三行语句为一个Vector类对象分配内存空间。
SL-275中指出:要为一个新对象分配空间必须执行new Xxx()调用,new调用执行以下的操作:
1.    为新对象分配空间并将其成员初始化为0或者null。
2.    执行类体中的初始化。(例如在类中有一个成员声明int a=10;在第一步后a=0,执行到第二步后a=10)
3.    执行构造函数。
4.    变量被分配为一个到内存堆中的新对象的引用。
 
8、Which of the following answer is correct to express the value 8 in octal number?
A. 010
B. 0x10
C. 08
D. 0x8
(a)
题目:下面的哪些答案可以用以表示八进制值8。
八进制值以0开头,以0x开头的为十六进制值,八进制中不能出现数字8,最大只有7。
 
9、Which are not Java keywords?
A. TRUE
B. sizeof
C. const
D. super
E. void
(ab)
题目:哪些不是Java关键字。
A: 不是,Java中有true,但是这也不是关键字而是字面量(literal)。
B: 不是,Java中不需要这个操作符,所有的类型(原始类型)的大小都是固定的。
C、D、E都是,需要说明的是const是java中未被使用的关键字。
 
10、Which of the following statements are true?
A. The equals() method determines if reference values refer to the same object.
B. The == operator determines if the contents and type of two separate objects match.
C. The equals() method returns true only when the contents of two objects match.
D. The class File overrides equals() to return true if the contents and type of two separate objects match.

上一页  [1] [2] [3] [4] [5] 下一页

责任编辑:cyth

文章搜索:
 相关文章
热点资讯
热门课程培训