| Java程序员认证模拟题及详细分析(1) |
|
|
|
作者:佚名 文章来源:不详 点击数: 更新时间:2006-12-3 8:41:03  |
value of variable to remain constant after the creation of the object?
16-20答安: 16。B 静态方法除了自己的参数外只能直接访问静态成员。访问非静态成员,必须先实例化本类的一个实例,再用实例名点取。 17。A、B、D polygon的顶点信息存放在Vector类型的对象内部,color定义为Color,length和width定义为int。 注意,这是考试中常见的题型。 18。C 此题考点是高级访问控制。请考生查阅高级访问控制说明表格。 19。B native关键字指明是对本地方法的调用,在JAVA中是只能访问但不能写的方法,它的位置在访问权限修饰语的后面及返回值的前面。 20。final 定义常量的方法是在变量定义前加final关键字。
21. Which is the main() method return of a application? A. String B. byte C. char D. void
22. Which is corrected argument of main() method of application? A. String args B. String ar[] C. Char args[][] D. StringBuffer arg[]
23. “The Employee object is a person, An Employee has appointment store in a vector, a hire date and a number of dependent” short answer: use shortest statement declare a class of Employee.
24. Give the following class defination inseparate source files: public class Example{ public Example(){//do something} protected Example(int i){//do something} protected void method(){//do something} } public class Hello extends Example{//member method and member variable} Which methods are corrected added to the class Hello? A. public void Example(){} B. public void method(){} C. protected void method(){} D. private void method(){}
25. Float s=new Float(0.9F); Float t=new Float(0.9F); Double u=new Double(0.9); Which expression?s result is true? A. s==t B. s.equals(t) C. s==u D. t.equals(u) 21-15答案: 21。D main()方法没有返回值,所以必须用void修饰。main()方法的返回值不能任意修改。 22。B main()方法的参数是字符串数组,参数名可以任意定义。 23。public class Employee extends Person 这也是真实考试中常见的一种题型。要注意题目叙述中“is a”表示 “extends”的含义。 24。A、B、C 考察的知识点是方法覆盖,其中要注意的是方法覆盖时,子类方法的访问权限不能小于父类方法的访问权限。另外,选项A并不是父类构造函数,它是子类中的新方法。 25。A、B 考察“==”及方法“equals()”的用法。注意以下几点区别: 1) 引用类型比较引用;基本类型比较值。 2) equals()方法只能比较引用类型,“==”可比较引用及基本类型。 3) 当用equals()方法进行比较时,对类File、String、Date及封装类(Wrapper Class)来说,是比较类型及内容。 4) 用“==”进行比较时,符号两边的数据类型必须一致(可相互转换的基本类型除外),否则编译出错。
上一页 [1] [2]
|
| 文章录入:bolang 责任编辑:bolang |
|
上一篇文章: Java程序员认证模拟题及详细分析(2) 下一篇文章: SUN认证Java2程序员考试(SCJP) 试题解析 |
| 【字体:小 大】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 |