动态网站制作指南
[  QQ表情  ]
[ 投票调查 ]
[ 企业邮箱 ]
[ 网站空间 ]
网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
ASP源码 | .Net源码 | PHP源码 | JSP源码 | JAVA源码 | CGI源码 | VB源码 | C++源码 | Delphi源码 | PB源码 | VF源码 | 汇编 | 服务器
电脑书籍下载:程序设计书籍 | 数据库教程书籍 | 平面与多媒体书籍 | 网络通讯书籍 | 系统管理书籍 | 网络安全书籍 | 认证考试书籍
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 认证考试 > Java认证
文章搜索服务
邮件订阅
输入你的邮件地址,
你将不会错过任何关于:
[ Java认证 ]的信息

本月文章推荐
.构架Linux环境下Java开发环境(2).
.Test of the Java Skill(3).
.高手支招:JBuilder常见疑难问题解.
.在JAVA中使用正则表达式.
.JAVA认证培训辅导:随机整数的生.
.Sun认证Java开发员-SCJD认证介绍.
.Sun SCJP考试心得.
.热点解析:SCWCD认证面面观.
.“编程美女”记:立志向编程牛人学.
.JAVA教师:给JAVA初学者.
.Jcreater+MotoJ2SDK的配置与使用.
.菜鸟第一招:给JAVA的初学者.
.Java:IT认证中最有魅力的开发工具.
.Java的前世今生.
.Java语言入门(2).
.课程介绍(4)SL-275 Java语言编程.
.Java学习路径-工具篇.
.课程介绍(2)SL-210 向Java面向对.
.JAVA考试认证:SCJP310-035考试心.
.JAVA的“精华”就在“面向对象思.

Java程序员认证模拟题及详细分析(3)

文章类别:Java认证 | 发表日期:2006-4-7 |


续:Java程序员认证模拟题及分析(1) 和(2)
   51. Which correctly create an array of five empty Strings?
   A. String a[] = new String[5];
   for (int i=0;i<5;a[i++]=””);
   B. String a []={“”,””,””,””,””};
   C. String a[5];
   D. String [5] a;
   E. String [] a = new String[5];
   for (int i = 0 ;i<5;a[i++] = null);

   52. Which cannot be added to a Container?
   A. an Applet
   B. a Component
   C. a Container
   D. a MenuComponent
   E. a panel

   53. Which is the return value of Event listener?s method?
   A. String B. AWTEvent C. void D. int

   54. If we implements MouseListener, which is corrected argument of its method? (short answer)

   55. Use the operator “>>” and “>>>”. Which statement is true?
   A. 1010 0000 0000 0000 0000 0000 0000 0000 >> 4 give
   0000 1010 0000 0000 0000 0000 0000 0000
   B. 1010 0000 0000 0000 0000 0000 0000 0000 >> 4 give
   1111 1010 0000 0000 0000 0000 0000 0000
   C. 1010 0000 0000 0000 0000 0000 0000 0000 >>> 4 give
   0000 1010 0000 0000 0000 0000 0000 0000
   D. 1010 0000 0000 0000 0000 0000 0000 0000 >>> 4 give
   1111 1010 0000 0000 0000 0000 0000 0000

   56. Give following fragment.
   Outer: for(int i=0; i<3; i++)
   inner:for(int j=0;j<3;j++){
   If(j>1)break outer;
   System.out.println(j+”and”+i);
   }
   Which will be output?
   A. 0 and 0 B. 0 and 1 C. 0 and 2 D. 0 and 3
   E. 1 and 0 F. 1 and 1 G. 1 and 2 H. 1 and 3
   I. 2 and 0 J. 2 and 1 K. 2 and 2 L. 2 and 3

   57. Examine the following code which includes an inner class:
   public final class Test4 implements A{
   class Inner{
   void test(){
   if (Test4.this.flag);{
   sample();
   }
   }
   private boolean flag=false;
   }
   public void sample(){
   System.out.println(“Sample”);
   }
   public Test4(){
   (new Inner()).test();
   }
   public static void main(String args[]){
   new Test4();
   }
   }
   What is the result:
   A.Print out “Sample”
   B.Program produces no output but termiantes correctly.
   C. Program does not terminate.
   D.The program will not compile

   58. What is written to the standard output given the following statement:
   System.out.println(4|7);
   Select the right answer:
   A.4
   B.5
   C.6
   D.7
   E.0

   59. Look the inheritance relation:
   person
|
----------------
| |
man woman
   In a source of java have the following line:
   person p=new man();
   What statement are corrected?
   A. The expression is illegal.
   B. Compile corrected but running wrong.
   C. The expression is legal.
   D. Will construct a person?s object.
   60. Look the inheritance relation:
   person
|
----------------
| |
man woman
   In a source of java have the following line:
   woman w=new man():

   What statement are corrected?
   A. The expression is illegal.
   B. Compile corrected but running wrong.
   C. The expression is legal.
   D. Will construct a woman object.

   61. Which can NOT be used in declaring or declaring and initializing an automatic (method local) variable?
   A. final
   B. static
   C. expressions
   D. Constants of non-primitive type
   E. initialized arrays (such as “ {“Hello”,”Good bye”}”).

   62. Given the following incomplete method:
   1) public void method(){
   2)
   3) if (someTestFails()){
   4)
   5) }
   6)
   7) }
   You want to make this method throw an IOException if,and only if,the method someTestFails() returns a value of true.
   Which changes achieve this?
   A. Add at line 2:IOException e;
   B. Add at line 4:throw e;
   C. Add at line 4:throw new IOException();
   D. Add at line 6:throw new IOException();
   E. Modify the method declaration to indicate that an object of type Exception might be thrown.
   63. Given the following definition:
   String s = null;
   Which code fragments cause an object of type NullPointerException to be thrown?
   A. if((s!=null)&(s.length()>0))
   B. if((s!=null)&&(s.length()>0))
   C. if((s==null)|(s.length()==0))
   D. if((s==null)||(s.length()==0))

   64. The following is a program
   1) class Exsuper{
   2) String name;
   3) String nick_name;
   4)
   5) public ExSuper(String s,String t){
   6) name = s;
   7) nick_name = t;
   8) }
   9)
   10) public string toString(){
   11) return name;
   12) }
   13) }
   14)
   15) public class Example extends ExSuper{
   16)
   17) public Example(String s,String t){
   18) super(s,t);
   19) }
   20)
   21) public String to String(){
   22) return name +”a.k.a”+nick_name;
   23) }
   24)
   25) public static void main(String args[]){
   26) ExSuper a = new ExSuper(“First”,”1st”);
   27) ExSuper b = new Example(“Second”,”2nd”);
   28)
   29) System.out.println(“a is”+a.toString());
   30) System.out.println(“b is”+b.toString());
   31) }
   32) }
   What happens when the user attempts to compile and run this program?
   A. A Compiler error occurs at line 21
   B. An object of type ClassCastException is thrown at line 27
   C.The following output:
   a is First
   b is second
   D. The following output:
   a is First
   b is Secong a.k.a 2nd
   F. The following output:
   a is First a.k.a 1st
   b is Second a.k.a 2nd

   65. Which statements are true about Listeners?
   A. At most one listener can be added to any simple Component.
   B. The return value from a listener is used to control the invocation of other listener
   C. If multiple listeners are added to a single component, they must all be made friends to each other
   D. If multiple listeners are added to single component, the order of invocation of the listener is not specified.
   E. In the AWT, listener methods generally take an argument, which is an instance of some subclass of java.awt.AWTEvent class.

答案及详细分析:
51。A、B
注意,每个对象变量在未初始化前都为“null”,并不为“空”。当为“空”时,它已经被分配具体内存空间了,与“null”有本质的区别。
52。D
菜单控件只能添加到叫做菜单容器的特殊对象中,而且布局管理器对菜单控件不起任何作用。
53。C
事件监听器方法就是句柄方法,所有句柄方法的访问权限都是public,返回值类型都是void。
54。MouseEvent
此题是考试中常见的题型。一般来说,句柄方法的参数类型与监听器类型是匹配的,只有监听器MouseMotionListener的句柄方法的参数类型是MouseEvent,与相应监听器类型名称不匹配。
55。B、C
“>>” 是带符号右移,高位是“1”则补“1”,否则补“0”;“>>>”是无符号右移,又叫补零右移,不论高位是什么,都是补“0”。
56。A、E
注意标号的使用。另外,break表示跳出本语句块的执行,continue继续本块的执行。
57。A
回答此题时,要仔细阅读程序,注意到语句“if(Test4.this.flag);”有一分号,这是没有执行语句的条件语句,所以“sample()”方法总是被调用。
58。D
“|”是按位或运算符,先将4和7转为二进制数。转换后就是计算“100|111”,所以得到结果是“111”,转为十进制整形数是7。此题提醒考生注意,要熟悉各种运算符号的含义。
59。C
这是多态性的定义方式,p是父类引用指向子类对象。此时,编译器认为p是一个person,而不是man ,所以p只能实现父类的功能。但是当p调用被覆盖方法时,是指向子类中的该方法。
60.A
多态性的定义允许父类引用指向子类对象,但是不允许两个平等的子类有这样的操作。所以该表达式是不合法的。
61.B
自动变量前不能用“static”修饰。
以下定义都是允许的:
final Date d = new Date();
String [] s = {“Hello”,”abc”};
int i = x+4;
所以只有B选项是正确。
62.C、E
所有自定义异常,在方法体中抛出了,就必须在方法声明中抛出。所以除了C选项外,E也必须入选。
63.A、C
逻辑运算符“&&”、“||”,在运算中有“短路”行为:例如 A&&B,如果A的值为false,则直接将整个表达式的值置为false,对B的值不加考察。而运算符“&”、“|”就没有这种行为。所以在选项A、C中,“s.length()”会导致抛出空指针异常。
64.D
源程序的第27行,是多态性的定义。对象b调用被覆盖方法时是调用子类中的该方法。
65.D、E
一个控件可以注册多个监听器,并且事件的响应没有特定的顺序。句柄方法的参数是类AWTEvent类的子类。

上一篇:Java程序员认证模拟题及详细分析(2) 人气:3005
下一篇:Java程序员认证模拟题及详细分析(4) 人气:2971
点击此处浏览全部Java认证的内容 Dreamweaver插件下载 常用网页广告代码全集
  最新网站源码 最新软件下载
2008-5-16 乘风多用户PHP统计系统 v3.4
2008-5-16 轩溪下载系统 v3.78 build 0515
2008-5-16 普沙B2B 浙江省商贸网 v2.0
2008-5-16 asp抓蜘蛛的小程序 v1.0
2008-5-16 齐齐乐网私服发布站 仿haosf新版
2008-5-16 IssTech信息反馈系统 v1.0
2008-5-16 自由领域大头贴(js接口版) 修正版
2008-5-16 医院网站系统
2008-5-16 智拓-分类信息管理系统 v5.0
2008-5-7 Windows XP SP3 官方英文版
2008-5-7 Windows XP SP3 官方香港中文版
2008-5-7 Windows XP SP3 官方繁体中文版
2008-5-7 Windows XP SP3 官方简体中文版
2008-4-30 Multiple Unzip Wizard 1.02
2008-4-30 Multiple Unrar Wizard 1.0.0
2008-4-30 WinZip Install/Try/Uninstall a
2008-4-30 ZIP压缩文件修复器WzipFix 2.0
2008-4-30 Pentazip 6.01 Build 189 For Wi
  发表评论
姓 名: 验证码: [ 全部贴吧 ] [ 浏览评论 ]
内 容:
[ 汉字翻译拼音 ] [ 广告代码 ] [ 符号对照表 ] [ 进制转换 ] [ 经典小工具 ] [ 个税计算 ] [ 汉字简繁转换 ] [ 普通单位换算 ] [ 公制单位换算 ]
[ 生辰老黄历 ] [ 国内电话区号 ] [ 国家代码与域名缩写 ] [ 文字加密解密 ] [ 健康查询 ] [ 万年历 ] [ 手机号码查询 ] [ ip搜索 ] [ Google PR查询 ]
业务联系 | 广告刊登 | 频道合作 | 投稿荐稿 | 联系方式 | 加入收藏 | RSS订阅
Copyright © 2000-2008 www.knowsky.com All rights reserved | 网络实名:动态网站制作指南 | 沪ICP备05001343号
ホームページ制作 不動産検索システム 求人情報