回到考试中心首页|兰州学生网LOGO
首页  |  外语考试  |  IT认证  |  基础教育  |  甘肃省专升本  |  学历考试  |  硕士学历  |  公务员  |  会计考试  |  职业资格  |  医学医药  |  建筑工程
会员登录
热门文章
·二级建造师模拟试题一套
·公务员面试自我介绍范文
·践行社会主义荣辱观 党课讲稿
·八荣八耻,从我做起!
·临床执业医师考试真题完全版(一)
·学习八荣八耻心得体会(完善版)
·八荣八耻演讲稿
·八荣八耻歌(歌词)
·英文自我介绍
·中学:教师资格认证考试全真模拟试卷和答案
·八荣八耻中学生演讲稿
·小学教师资格考试教育学仿真试题之一
·八荣八耻手抄报内容
·《八荣八耻歌》歌词 伴奏及曲牌
·暑期实践报告
广告推荐
Java认证模拟题及分析(4)
作者: 来源: 责任编辑: 更新日期:2006-3-27 19:38:36 浏览:
Java认证模拟题及分析(4)

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

Question 50)
Given the following code

import java.io.*;
public class Th{
public static void main(String argv[]){
Th t = new Th();
t.amethod();
}
public void amethod(){
try{
ioCall();
}catch(IOException ioe){}
}
}


What code would be most likely for the body of the ioCall method

1) public void ioCall ()throws IOException{
DataInputStream din = new DataInputStream(System.in);
din.readChar();
}
2) public void ioCall ()throw IOException{
DataInputStream din = new DataInputStream(System.in);
din.readChar();
}
3) public void ioCall (){
DataInputStream din = new DataInputStream(System.in);
din.readChar();
}
4) public void ioCall throws IOException(){
DataInputStream din = new DataInputStream(System.in);
din.readChar();

}
Answer to Question 50


--------------------------------------------------------------------------------

Question 51)
What will happen when you compile and run the following code?

本文章共2页,当前在第1页  1  2  

打印本文 收藏本文 返回顶部 关闭窗口
   考试中心分类导航
      外语考试 | 英语四六级 | 专四专八 | 职称英语 | 口译笔译 | 商务英语 | 实用英语 | 托福 | 雅思 | GRE | LSAT | PETS | GMAT
      IT认证 | 计算机等级 | 软件程序员 | 微软认证 | 思科认证 | Oracle | Linux | JAVA
      甘肃省专升本 | 专升本动态 | 招生计划 | 考试大纲 | 专升本试题    基础教育 | 中考 | 高考    学历考试 | 成人高考 | 自学考试
      硕士学历 | 考研 | MBA/EMBA | 在职硕士 | 法律硕士 | 会计硕士 | 工程硕士    公务员 | 考试动态 | 考试指导 | 考试真题 | 模拟题 | 技巧心得
      医学医药 | 执业护士 | 执业医师 | 执业药师    会计考试 | 资产评估 | 经济师 | 从业资格 | 会计职称 | 注会 | 注税 | 高级会计 | ACCA/CAT | 精算师
      职业资格 | 保险考试 | 报关员 | 外销员 | 物流师 | 报检员 | 司法考试 | 律师考试 | 商务师 | 人力资源 | 电子商务 | 导游资格 | 证券考试 | 教师资格
      建筑工程 | 岩土师 | 室内设计师 | 质量资格 | 房产估价 | 土地估价 | 建造师 | 造价师 | 建筑师 | 结构师 | 监理师 | 咨询师 | 城市规划 | 安全工程师
设为首页   |    收藏本站   |    网站帮助   |    网站地图   |    意见反馈   |    关于我们   |    广告服务   |    联系办法
陇ICP备05005179 不良信息举报