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

SCJP Mock Exam 1(2)

 

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

 

 

       

Q11
What is wrong with the following code?

class MyException extends Exception {}

public class Qb4ab {
public void foo() {
try {
bar();
} finally {
baz();
} catch (MyException e) {}
}
public void bar() throws MyException {
throw new MyException();
}
public void baz() throws RuntimeException {
throw new RuntimeException();
}
}

1) Since the method foo() does not catch the exception generated by the method baz(), it must declare the RuntimeException in its throws clause.
2) A try block cannot be followed by both a catch and a finally block.
3) An empty catch block is not allowed.
4) A catch block cannot follow a finally block.
5) A finally block must always follow one or more catch blocks.

Q12
What will be written to the standard output when the following program is run?

public class Qd803 {
public static void main(String args[]) {
String word = "restructure";
System.out.println(word.substring(2, 3));
}
}

1) est
2) es
3) str
4) st
5) s

Q13
Given that a static method doIt() in a class Work represents work to be done, what block of code will succeed in starting a new thread that will do the work?

CODE BLOCK A:
Runnable r = new Runnable() {
public void run() {
Work.doIt();
}
};
Thread t = new Thread(r);
t.start();

CODE BLOCK B:
Thread t = new Thread() {
public void start() {
Work.doIt();
}
};
t.start();

CODE BLOCK C:
Runnable r = new Runnable() {
public void run() {
Work.doIt();
}
};
r.start();

CODE BLOCK D:
Thread t = new Thread(new Work());
t.start();

CODE BLOCK E:
Runnable t = new Runnable() {
public void run() {
Work.doIt();
}
};
t.run();

1) Code block A.
2) Code block B.
3) Code block C.
4) Code block D.
5) Code block E.

Q14
Write a line of code that declares a variable named layout of type LayoutManager and initializes it with a new object, which when used with a container can lay out components in a rectangular grid of equal-sized rectangles, 3 components wide and 2 components high.

Q15
public class Q275d {
static int a;
int b;
public Q275d() {
int c;
c = a;
a++;
b += c;
}
public static void main(String args[]) {
new Q275d();
}
}

1) The code will fail to compile, since the constructor is trying to access static members.
2) The code will fail to compile, since the constructor is trying to use static member variable a before it has been initialized.
3) The code will fail to compile, since the constructor is trying to use member variable b before it has been initialized.
4) The code will fail to compile, since the constructor is trying to use local variable c before it has been initialized.
5) The code will compile and run without any problems.

Q16
What will be written to the standard output when the following program is run?

public class Q63e3 {
public static void main(String args[]) {
System.out.println(9 ^ 2);
}
}

1) 81
2) 7
3) 11
4) 0
5) false

Q17
Which statements are true concerning the default layout manager for containers in the java.awt package?

1) Objects instantiated from Panel do not have a default layout manager.
2) Objects instantiated from Panel have FlowLayout as default layout manager.
3) Objects instantiated from Applet have BorderLayout as default layout manager.
4) Objects instantiated from Dialog have BorderLayout as default layout manager.
5) Objects instantiated from Window have the same default layout manager as instances of Applet.

Q18
Which declarations will allow a class to be started as a standalone program?

1) public void main(String args[])
2) public void static main(String args[])
3) public static main(String[] argv)

 

 

 

上下文章:

 

上一篇文章: SCJP Mock Exam 1(1) 下一篇文章: SCJP Mock Exam 1(3)

相关文章:

  • 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 第九软件网 版权所有