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

SCJP Mock Exam 4(9)

 

添加时间: 2007-9-23 2:18:22  作者: JAVA题库  阅读次数:59   来源: http://www.d9soft.com

 

 

       

Question 59)
What will happen when you attempt to compile and run the following code

class Base{
private void amethod(int iBase){
System.out.println("Base.amethod");
}
}

 

class Over extends Base{
public static void main(String argv[]){
Over o = new Over();
int iBase=0;
o.amethod(iBase);
}

public void amethod(int iOver){
System.out.println("Over.amethod");
}
}
1) Compile time error complaining that Base.amethod is private
2) Runtime error complaining that Base.amethod is private
3) Output of "Base.amethod"
4) Output of "Over.amethod"


Answer to Question 59


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

Question 60)
You are creating an applet with a Frame that contains buttons. You are using the GridBagLayout manager and you have added Four buttons. At the moment the buttons appear in the centre of the frame from left to right. You want them to appear one on top of the other going down the screen. What is the most appropriate way to do this.


1) Set the gridy value of the GridBagConstraints class to a value increasing from 1 to 4
2) set the fill value of the GridBagConstraints class to VERTICAL
3) Set the ipady value of the GridBagConstraints class to a value increasing from 0 to 4
4) Set the fill value of the GridBagLayouts class to GridBag.VERTICAL

Answer to Question 60

If you have a copy of the Roberts and Heller Java 2 Guide that says the exam does not cover the GridBagLayout, this is an error. You can confirm this by looking at the online errata at

http://www.sybex.com/cgi-bin/rd_err_temp.pl?2463err.html


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

Answers

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

Answer 1)
Back to question 1)
Objective 4.5)

5) int i=10;

explanation:
1) float f=1.3;
Will not compile because the default type of a number with a floating point component is a double. This would compile with a cast as in

float f=(float) 1.3


2) char c="a";

Will not compile because a char (16 bit unsigned integer) must be defined with single quotes. This would compile if it were in the form

char c='a';

3) byte b=257;

Will not compile because a byte is eight bits. Take of one bit for the sign component you can define numbers between

-128 to +127

4) a boolean value can either be true or false, null is not allowed


http://www.jchq.net/tutorial/04_05Tut.htm.


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

Answer 2)
Back to question 2)

Objective 4.1

1) Can't make static reference to void amethod.

Because main is defined as static you need to create an instance of the class in order to call any non-static methods. Thus a typical way to do this would be.


MyClass m=new MyClass();

m.amethod();


Answer 2 is an attempt to confuse because the convention is for a main method to be in the form

String argv[]

That argv is just a convention and any acceptable identifier for a string array can be used. Answers 3 and 4 are just nonsense.

http://www.jchq.net/tutorial/04_01Tut.htm

 

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

Answer 3)
back to Question 3)
Objective 4.1)

2 and 3 will compile without error.


1 will not compile because any package declaration must come before any other code. Comments may appear anywhere

http://www.jchq.net/tutorial/04_01Tut.htm .


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

Answer 4)
Back to question 4)

 

 

 

上下文章:

 

上一篇文章: SCJP Mock Exam 4(8) 下一篇文章: SCJP Mock Exam 4(10)

相关文章:

  • Sandy’socp1z0-001Exam
  • SCJP Mock Exam 2(2)
  • SCJP Mock Exam 2(1)
  • SCJP Mock Exam 1(8)
  • SCJP Mock Exam 1(7)

相关软件:

  • ExamXML V4.20
  • ExamDiff Pro V3.3 汉化版
  • ExamDiff V1.6m
  • ExamDiff Pro V3.4 beta 1223
  • Examine32 4.03 汉化版
  • Examine32 4.3

 

 

快速导航

  • 网络学院
  • 精品汇聚
  • 字体下载
  • 教程下载
  • 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题库阅读排行

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

JAVA认证阅读总排行

  • JAVA题库:考考你4
  • SCJP Mock Exam 2(2)
  • JAVA题库:考考你2
  • Java认证模拟题及分析(3)
  • Java认证模拟题及分析(1)
  • SCJP考试真题和解析[1](2)
  • 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 第九软件网 版权所有