SCJP试题-SCJPMockExam1

来源:java认证发布时间:2012-11-12 12:48:18java认证视频

Q1
A method is ...

1) an implementation of an abstraction.
2) an attribute defining the property of a particular abstraction.
3) a category of objects.
4) an operation defining the behavior for a particular abstraction.
5) a blueprint for making operations.

Q2
An object is ...

1) what classes are instantiated from.
2) an instance of a class.
3) a blueprint for creating concrete realization of abstractions.
4) a reference to an attribute.
5) a variable.

Q3
Which line contains a constructor in this class definition?

public class Counter { // (1)
int current, step;
public Counter(int startValue, int stepValue) { // (2)
set(startValue);
setStepValue(stepValue);
}
public int get() { return current; } // (3)
public void set(int value) { current = value; } // (4)
public void setStepValue(int stepValue) { step = stepValue; } // (5)
}

1) Code marked with (1) is a constructor
2) Code marked with (2) is a constructor
3) Code marked with (3) is a constructor
4) Code marked with (4) is a constructor
5) Code marked with (5) is a Constructor

Q4
Given that Thing is a class, how many objects and reference variables are created by the following code?

Thing item, stuff;
item = new Thing();
Thing entity = new Thing();

1) One object is created
2) Two objects are created
3) Three objects are created
4) One reference variable is created
5) Two reference variables are created
6) Three reference variables are created.

上一页123456下一页

视频学习

我考网版权与免责声明

① 凡本网注明稿件来源为"原创"的所有文字、图片和音视频稿件,版权均属本网所有。任何媒体、网站或个人转载、链接转贴或以其他方式复制发表时必须注明"稿件来源:我考网",违者本网将依法追究责任;

② 本网部分稿件来源于网络,任何单位或个人认为我考网发布的内容可能涉嫌侵犯其合法权益,应该及时向我考网书面反馈,并提供身份证明、权属证明及详细侵权情况证明,我考网在收到上述法律文件后,将会尽快移除被控侵权内容。

最近更新

社区交流

考试问答