• 网络学院
  • IT资讯
  • 操作系统
  • 网络技术
  • 软件应用
  • 办公软件
  • 编程技术
  • 网站架设
  • 数据库类
  • 平面设计
  • 多媒体类
  • 游戏资讯
  • 教学论文
  • 认证考试
格林模拟试题二参考答案(1)
  站点:
  • 首 页
  • 最新软件
  • 文章教程
  • 国内软件
  • 国外软件
  • 绿色软件
  • 源码下载
  • 字体下载
格林模拟试题二参考答案(1)
软件发布 格林模拟试题二参考答案(1)
网络软件 系统工具 应用软件 联络聊天 图形图像 多媒体类 行业软件 游戏娱乐 编程开发 安全相关 教育教学 数码软件 绿软下载
热门软件: QQ 瑞星 pplive e话通 木马克星 千千静听 office2000 五笔字根 Photoshop 视频分割
返回文章教程首页 >> 文章首页 >> 认证考试 >> JAVA认证 >> JAVA题库 >> 格林模拟试题二参考答案(1)

格林模拟试题二参考答案(1)

添加时间: 2007-9-22 6:33:10  作者: JAVA认证考试  阅读次数:69   来源: http://www.d9soft.com

       

Answers

Answer 1)

1) The code will compile and run, printing out the words "My Func"

A class that contains an abstract method must be declared abstract itself, but may contain non abstract methods.

Answer 2)

4) The code will compile but will complain at run time that main is not correctly defined

In this example the parameter is a string not a string array as needed for the correct main method

Answer 3)

1) public
2) private
4) transient

The keyword transient is easy to forget as is not frequently used. Although a method may be considered to be friendly like in C++ it is not a Java keyword.

Answer 4)

2) The compiler will complain that the Base class is not declared as abstract.

If a class contains abstract methods it must itself be declared as abstract
Answer 5)

1) To get to access hardware that Java does not know about
3) To write optimised code for performance in a language such as C/C++
Answer 6)

4) Success in compilation and output of "amethod" at run time.

A final method cannot be ovverriden in a sub class, but apart from that it does not cause any other restrictions.

Answer 7)

4) Compilation and execution without error

It would cause a run time error if you had a call to amethod though.

Answer 8)

1)Compile time error: Base cannot be private

A top leve (non nested) class cannot be private.

Answer 9)

4) P1 compiles cleanly but P2 has an error at compile time

The package statement in P1.java is the equivalent of placing the file in a different directory to the file P2.java and thus when the compiler tries to compile P2 an error occurs indicating that superclass P1 cannot be found.

Answer 10)

2) An error at run time

This code will compile, but at run-time you will get an ArrayIndexOutOfBounds exception. This becuase counting in Java starts from 0 and so the 5th element of this array would be i[4].

Remember that arrays will always be initialized to default values wherever they are created.


Answer 11)

2)myarray.length;

The String class has a length() method to return the number of characters. I have sometimes become confused between the two.

Answer 12)

3) A Frame with one large button marked Four in the Centre

The default layout manager for a Frame is the BorderLayout manager. This Layout manager defaults to placing components in the centre if no constraint is passed with the call to the add method.

Answer 13)

4) Do nothing, the FlowLayout will position the component

Answer 14)

1) Use the setLayout method

Answer 15)

1) ipadx
2) fill
3) insets

Answer 16)

2) The buttons will run from left to right along the top of the frame

The call to the setLayout(new FlowLayout()) resets the Layout manager for the entire frame and so the buttons end up at the top rather than the bottom.

Answer 17)

2) It is a field of the GridBagConstraints class for controlling component placement
3) A valid settting for the anchor field is GridBagconstraints.NORTH

Answer 18)

4) Clean compile but no output at runtime


This is a bit of a sneaky one as I have swapped around the names of the methods you need to define and call when running a thread. If the for loop were defined in a method called public void run() and the call in the main method had been to b.start() The list of values from 0 to 9 would have been output.

Answer 19)

2) false

You can re-use the same instance of the GridBagConstraints when added successive components.


Answer 20)

4) An interface that ensures that implementing classes cannot contain duplicates

Answer 21)

2) The add method returns false if you attempt to add an element with a duplicate value

I find it a surprise that you do not get an exception.

Answer 22)

1) The program exits via a call to exit(0);
2) The priority of another thread is increased
3) A call to the stop method of the Thread class

Note that this question asks what can cause a thread to stop executing, not what will cause a thread to stop executing. Java threads are somewhat platform dependent and you should be carefull when making assumptions about Thread priorities. On some platforms you may find that a Thread with higher priorities gets to "hog" the processor. You can read up on this in more detail at

 

上下文章:

 

上一篇文章: JAVA题库:考考你4 下一篇文章: 格林模拟试题二参考答案(2)

相关文章:

  • 史上最强的几道oracle面试题
  • 国外公司的Oracle DBA试题
  • 今年4月三级数据库笔试试题及答案
  • Oracle DBA 逻辑备份试题选
  • 国外某公司的Oracle DBA试题

相关软件:

  • 全国计算机等级考试模拟软件(2006年全年使用)二级Visual Basic V9.0
  • 白金模拟炒股平台 V3.6
  • 全国计算机等级考试第21次全真模拟系统 20050311
  • 全国专业技术人员计算机应用能力考试模拟 2.1
  • 中考物理试卷分类试题 4.1
  • 计算机等级考试训练模拟软件(三级网络技术) V1.04

 

快速导航

  • 网络学院
  • 精品汇聚
  • 字体下载
  • 教程下载
  • ASP源码
  • PHP源码
  • Net源码
  • JSP 源码

JAVA认证分类导航

  • JAVA动态
  • JAVA指导
  • JAVA题库

本类经典文章推荐

  • SCJP模拟试题[2](2)
  • SCJP模拟试题[2](1)
  • SCJP考试真题和解析[1](2)
  • SCJP Mock Exam 3(1)
  • SCJP考试题310-025[5](1)
  • Java网络编程之URI、URL研究专题一
  • Java认证模拟题及分析(1)
  • SCJP模拟试题[1](3)
  • Java认证模拟题及分析(3)
  • SCJP考试真题和解析[2](3)

JAVA题库阅读排行

  • SCJP Mock Exam 2(2)
  • JAVA题库:考考你4
  • JAVA题库:考考你2
  • Java认证模拟题及分析(3)
  • SCJP考试真题和解析[1](2)
  • Java认证模拟题及分析(1)
  • JAVA题库:格林模拟试题一(上)(2)
  • SCJP模拟试题[2](3)
  • SCJP模拟试题[2](1)
  • SCJP考试真题和解析[1](1)

JAVA认证阅读总排行

  • SCJP Mock Exam 2(2)
  • JAVA题库:考考你4
  • JAVA题库:考考你2
  • Java认证模拟题及分析(3)
  • SCJP考试真题和解析[1](2)
  • Java认证模拟题及分析(1)
  • JAVA题库:格林模拟试题一(上)(2)
  • SCJP模拟试题[2](3)
  • SCJP模拟试题[2](1)
  • SCJP考试真题和解析[1](1)

广告位置

字母检索 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 回到顶部

关于我们 | 版权声明 | 免责条款 | 广告联系 | 软件发布 | 下载帮助 | 下载排行 | 网站地图 | 特别鸣谢 | 友情连接

copyright; 2005-2008 D9soft.com 第九软件网 版权所有