Java认证模拟题及分析4
百度广告
question 45
public class ref{
ref r = new ref();
}
int i=99;
system.out.println(i);
public void multi(ref r){
}
1) error at compile time
3) an output of 198
answer to question 45
--------------------------------------------------------------------------------
you need to create a class that will store unique object elements. you do not need to sort these elements but they must be unique.
1)set
3)map
answer to question 46
--------------------------------------------------------------------------------
which of the following will successfully create an instance of the vector class and add an element?
v[1]=99;
2) vector v=new vector();
3) vector v=new vector();
4 vector v=new vector(100);
answer to question 47
--------------------------------------------------------------------------------
you have created a simple frame and overridden the paint method as follows
g.drawstring('dolly',50,10);
what will be the result when you attempt to compile and run the program?
2) an error at compilation complaining at the signature of the paint method
4) the string 'dolly' will be shown at the bottom of the frame.
--------------------------------------------------------------------------------
what will be the result when you attempt to compile this program?
public static void main(string argv){
irand = math.random();
}
1) compile time error referring to a cast problem
3) a random number between 0 and 1
answer to question 49
编辑推荐:
温馨提示:因考试政策、内容不断变化与调整,长理培训网站提供的以上信息仅供参考,如有异议,请考生以权威部门公布的内容为准! (责任编辑:长理培训)
点击加载更多评论>>