报课、招生咨询电话:010-51268840/41

首页 > 计算机考试 > 试题汇编 > JAVA考试 > 试题 >
→论坛登陆 用户名  密码  
Java认证模拟题及分析4

作者: 发布时间:2008-05-21 11:35:46 来源:育路计算机考试频道

question 45 
what will happen when you try compiling and running this code? 
public class ref{ 
public static void main(string argv[]){ 
ref r = new ref(); 
r.amethod(r); 

public void amethod(ref r){ 
int i=99; 
multi(r); 
system.out.println(i); 

public void multi(ref r){ 
r.i = r.i*2; 


1) error at compile time 
2) an output of 99 
3) an output of 198 
4) an error at runtime 
answer to question 45 

-------------------------------------------------------------------------------- 
question 46) 
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. 
what interface might be most suitable to meet this need? 
1)set 
2)list 
3)map 
4)vector 

answer to question 46 

-------------------------------------------------------------------------------- 
question 47) 
which of the following will successfully create an instance of the vector class and add an element? 
1) vector v=new vector(99); 
v[1]=99; 

2) vector v=new vector(); 
v.addelement(99); 

3) vector v=new vector(); 
v.add(99); 

4 vector v=new vector(100); 
v.addelement('99'); 
answer to question 47 

-------------------------------------------------------------------------------- 
question 48) 
you have created a simple frame and overridden the paint method as follows 
public void paint(graphics g){ 
g.drawstring('dolly',50,10); 

what will be the result when you attempt to compile and run the program? 
1) the string 'dolly' will be displayed at the centre of the frame 
2) an error at compilation complaining at the signature of the paint method 
3) the lower part of the word dolly will be seen at the top of the frame, with the top hidden. 
4) the string 'dolly' will be shown at the bottom of the frame. 
answer to question 48 

-------------------------------------------------------------------------------- 
question 49) 
what will be the result when you attempt to compile this program? 
public class rand{ 
public static void main(string argv[]){ 
int irand; 
irand = math.random(); 
system.out.println(irand); 

1) compile time error referring to a cast problem 
2) a random number between 1 and 10 

3) a random number between 0 and 1
4) a compile time error about random being an unrecognised method

answer to question 49

    育路网
 
 
                                        
评论】【加入收藏夹】【 】【打印】【关闭
育路网2007年夏令营联展
 更多有关新闻:
 
·[考试动态2008年医师资格考试网上报名须知 ·[考试动态2008年医师资格考试3月10日开始网
·[考试动态卫生部医师资格考试委员会公告 ·[考试动态2008年医师考试于9月20至21进行
·[考试动态关于北京考区2008年度国家医师资 ·[考试动态崇文区卫生局关于北京考区2008年
·[考试动态丰台区卫生局关于北京考区2008年 ·[考试动态2008年上海市医师资格考试(考区
·[考试动态2008年医师资格考试(天津考区) ·[考试动态惠州市卫生局关于2008医师资格考
·[考试动态无锡市关于2008年医师资格考试网 ·[考试动态关于珠海市2008年医师资格考试的
·[考试动态韶关市关于2008年医师资格考试网 ·[考试动态深圳市关于2008年医师资格考试深
·[考试动态杭州市卫生局关于2008年医师资格 ·[考试动态丽水市关于2008年医师资格考试报
发表评论
用户名: 密码:
验证码: 匿名发表
课程搜索:
选择分类:
课程关键字:
课程 学校
 2008年首都高校秋季招生
北京理工大学2008年招生简章
北京文理研修学院2008年招生简章
北京建设大学2008年招生简章
北京中山学院2008年招生简章
北京城市学院2008年招生简章
培黎职业学院2008年招生简章
北京金融学院2008年招生简章
北京吉利大学2008年招生简章
北方工商管理学院2008年招生简章
 本周推荐课程
·初中起点雅思半年脱产 ·启德雅思6分冲刺课程
·新概念1+2册慢速精讲课 ·环球新托福100分强化
·北文王长喜四级强化班 ·英语四、六级培训课程
·海文考研数学课程 ·海文考研英语课程
·北大企业管理高级研修班 ·清华企业领导人研修班
·中美高中生交换项目 ·北工大中加学院2+2本科
·劳动和社会保障部物流师 ·物业管理师职业培训
·市场营销经理国际资格 ·现场管理实务培训
清华大学留学
中法管理硕士预科班
课程咨询热线:010-51268840 51268841
 最新新闻
·2008年北京在职公务员精讲周末班开班通知
·哈尔滨市一公务员请年假到灾区当心理医生
·网友解析08年5月17日安徽省公务员面试真题
·清华大学领导演讲口才与管理沟通高级精品班
·高效演讲与沟通技巧培训班
·高中毕业生出国留学 给自己机会给家庭机会
·IELTS成绩如何计算
·IELTS成绩如何计算
·2008年5月22日雅思考试预测
·公务员面试技巧:向考官解释问题时的六项注意
 育路社区            进入>>
 
学员报名服务中心: 北京北三环西路32号恒润中心1806(交通位置图
咨询电话:北京- 010-51268840/41 传真:010-51418040 上海-021-64392659、64397431
育路网-中国新锐教育社区: 北京站 | 上海站 | 郑州站| 武汉站
本站法律顾问: 邱清荣律师
北京育路互联科技有限公司版权所有 | 京ICP备05012189号