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

SCJP考试题310-025[5](2)

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

       

D. Compilation succeeds but the program throws an exception.
Answer: B
QUESTION NO 114
Which two are equivalent? (Choose Two)
A. 3/2
B. 3<2
C. 3*4
D. 3<<2
E. 3*2^2
F. 3<<<2
Answer: C, D
QUESTION NO 115
What is the numerical range of a char?
A. 0 . . . 32767
B. 0 . . . 65535
C. –256 . . . 255
D. –32768 . . . 32767
E. Range is platform dependent.
Answer: B
QUESTION NO 116
Given:
1. public class Test {
2. public static void main (String []args) {
3. unsigned byte b = 0;
4. b--;
5.
6. }
7. }
What is the value of b at line 5?
A. -1
B. 255
C. 127
D. Compilation will fail.
E. Compilation will succeed but the program will throw an exception at line 4.
Answer: D
QUESTION NO 117
Given:
1. public class Foo {
2. public void main (String [] args) {
3. system.out.printIn(“Hello World.”);
4. }
5. }
What is the result?
A. An exception is thrown.
B. The code does no compile.
C. “Hello World.” Is printed to the terminal.
D. The program exits without printing anything.
Answer: A
QUESTION NO 118
Given:
1. //point X
2. public class foo (
3. public static void main (String[]args) throws Exception {
4. java.io.printWriter out = new java.io.PrintWriter (
5. new java.io.outputStreamWriter (System.out), true;
6. out.printIn(“Hello”);
7. }
8. }
Which statement at PointX on line 1 allows this code to compile and run?
A. Import java.io.*;
B. Include java.io.*;
C. Import java.io.PrintWriter;
D. Include java.io.PrintWriter;
E. No statement is needed.
Answer: E
QUESTION NO 119
Which will declare a method that is available to all members of the same package and can be referenced
without an instance of the class?
A. Abstract public void methoda();
B. Public abstract double methoda();
C. Static void methoda(double d1){}
D. Public native double methoda() {}
E. Protected void methoda(double d1) {}
Answer: C
QUESTION NO 120
Which type of event indicates a key pressed on a java.awt.Component?
A. KeyEvent
B. KeyDownEvent
C. KeyPressEvent
D. KeyTypedEvent
E. KeyPressedEvent
Answer: A
QUESTION NO 121
Exhibit:
1. import java.awt.*;
2.
3. public class X extends Frame {
4. public static void main (String [] args) {
5. X x = new X();
6. x.pack();
7. x.setVisible(true);
8. }
9.
10. public X() {

11. setLayout (new BordrLayout());
12. Panel p = new Panel ();
13. add(p, BorderLayout.NORTH);
14. Button b = new Button (“North”);
15. p.add(b):
16. Button b = new Button (“South”);
17. add(b1, BorderLayout.SOUTH):
18. }
19. }
Which two statements are true? (Choose Two)
A. The buttons labeled “North” and “South” will have the same width.
B. The buttons labeled “North” and “South” will have the same height.
C. The height of the button labeled “North” can very if the Frame is resized.
D. The height of the button labeled “South” can very if the Frame is resized.
E. The width of the button labeled “North” is constant even if the Frame is resized.
F. The width of the button labeled “South” is constant even if the Frame is resized.
Answer: B, E
QUESTION NO 122
How can you create a listener class that receives events when the mouse is moved?
A. By extending MouseListener.
B. By implementing MouseListener.
C. By extending MouseMotionListener.
D. By implementing MouseMotionListener.
E. Either by extending MouseMotionListener or extending MouseListener.
F. Either by implementing MouseMotion Listener or implementing MouseListener.
Answer: D
QUESTION NO 123
Which statement is true?
A. A grid bag layout can position components such that they span multiple rows and/or columns.
B. The “North” region of a border layout is the proper place to locate a menuBar component in a
Frame.
C. Components in a grid bag layout may either resize with their cell, or remain centered in that cell at
their preferred size.
D. A border layout can be used to position a component that should maintain a constant size even
when the container is resized.
Answer: A
QUESTION NO 124
You want a class to have access to members of another class in the same package. Which is the most
restrictive access modifier that will accomplish that will accomplish this objective?
A. Public
B. Private
C. Protected
D. Transient
E. No access modifier is required.
Answer: E
QUESTION NO 125
Which two statements are true regarding the creation of a default constructor? (Choose Two)
A. The default constructor initializes method variables.
B. The default constructor invokes the no-parameter constructor of the superclass.
C. The default constructor initializes the instance variables declared in the class.
D. If a class lacks a no-parameter constructor,, but has other constructors, the compiler creates a

default constructor.
E. The compiler creates a default constructor only when there are no other constructors for the class.
Answer: C, E
QUESTION NO 126
Given:
1. public class OuterClass {
2. private double d1 1.0;
3. //insert code here
4. }
You need to insert an inner class declaration at line2. Which two inner class declarations are valid?
(Choose Two)
A. static class InnerOne {
public double methoda() {return d1;}
}
B. static class InnerOne {
static double methoda() {return d1;}
}
C. private class InnerOne {
public double methoda() {return d1;}
}
D. protected class InnerOne {
static double methoda() {return d1;}
}
E. public abstract class InnerOne {
public abstract double methoda();
}
Answer: C, E

QUESTION NO 127
Which two declarations prevent the overriding of a method? (Choose Two)
A. Final void methoda() {}
B. Void final methoda() {}
C. Static void methoda() {}
D. Static final void methoda() {}
E. Final abstract void methoda() {}
Answer: A, D
QUESTION NO 128
Given:
1. public class Test {
2. public static void main (String args[]) {
3. class Foo {
4. public int i = 3;
5. }
6. Object o = (Object) new Foo();
7. Foo foo = (Foo)o;
8. System.out.printIn(foo. i);
9. }
10. }
What is the result?
A. Compilation will fail.
B. Compilation will succeed and the program will print “3”
C. Compilation will succeed but the program will throw a ClassCastException at line 6.
D. Compilation will succeed but the program will throw a ClassCastException at line 7.
Answer: B
QUESTION NO 129
Which two create an instance of an array? (Choose Two)
A. int[] ia = new int [15];
B. float fa = new float [20];
C. char[] ca = “Some String”;
D. Object oa = new float[20];
E. Int ia [][] = (4, 5, 6) (1, 2, 3)
Answer: A, D
QUESTION NO 130
Given:
1. public class ExceptionTest {
2. class TestException extends Exception {}
3. public void runTest () throws TestException {}
4. public void test () /* Point X*/ {
5. runTest ();
6. }
7. }
At point X on line 4, which code can be added to make the code compile?
A. Throws Exception.
B. Catch (Exception e).
C. Throws RuntimeException.
D. Catch (TestException e).
E. No code is necessary.
Answer: B
QUESTION NO 131
Exhibit:
1. public class SwitchTest {
2. public static void main (String []args) {

3. System.out.PrintIn(“value =” +switchIt(4));
4. }
5. public static int switchIt(int x) {
6. int j = 1;
7. switch (x) {
8. case 1: j++;
9. case 2: j++;
10. case 3: j++;
11. case 4: j++;
12. case 5: j++;
13. default:j++;
14. }
15. return j + x;
16. }
17. }
What is the output from line 3?
A. Value = 3
B. Value = 4
C. Value = 5
D. Value = 6
E. Value = 7
F. Value = 8
Answer: F
QUESTION NO 132
Which four types of objects can be thrown using the throw statement? (Choose Four)
A. Error
B. Event
C. Object
D. Exception
E. Throwable
F. RuntimeException
Answer: A, D, E, F
QUESTION NO 133
Given:
1. public class ForBar {
2. public static void main(String []args) {
3. int i = 0, j = 5;
4. tp: for (;;) {
5. i ++;
6. for(;;)
7. if(i > --j) break tp;
8. }
9. system.out.printIn(“i = ” + i + “, j = “+ j);
10. }
11. }
What is the result?
A. The program runs and prints “i=1, j=0”
B. The program runs and prints “i=1, j=4”
C. The program runs and prints “i=3, j=4”
D. The program runs and prints “i=3, j=0”
E. An error at line 4 causes compilation to fail.
F. An error at line 7 causes compilation to fail.
Answer: A
QUESTION NO 134
Which two can directly cause a thread to stop executing? (Choose Two)
A. Exiting from a synchronized block.
B. Calling the wait method on an object.
C. Calling the notify method on an object.
D. Calling the notifyAll method on an object.
E. Calling the setPriority method on a thread object.
Answer: B, E
QUESTION NO 135
Given:
1. public class Foo implements Runnable (
2. public void run (Thread t) {
3. system.out.printIn(“Running.”);
4. }
5. public static void main (String[] args) {
6. new thread (new Foo()).start();
7. )
8. )
What is the result?
A. An exception is thrown.
B. The program exists without printing anything.
C. An error at line 1 causes compilation to fail.
D. An error at line 6 causes the compilation to fail.
E. “Running” is printed and the program exits.
Answer: C
QUESTION NO 136
Which constructs a DataOutputStream?
A. New dataInputStream(“in.txt”);
B. New dataInputStream(new file(“in.txt”));
C. New dataInputStream(new writer(“in.txt”));
D. New dataInputStream(new FileWriter(“in.txt”));
E. New dataInputStream(new InputStream(“in.txt”));
F. New dataInputStream(new FileInputStream(“in.txt”));

 

上下文章:

 

上一篇文章: SCJP考试题310-025[5](1) 下一篇文章: SCJP考试题310-025[5](3)

相关文章:

  • ORACLE OCP认证的各门考试科目
  • Oracle认证专家考试科目一览表
  • Oracle10g认证考试途径详解
  • 官方公布Oracle10gOCA考试已经开始
  • 官方消息:Oracle 10g OCP DBA的考试科目减少到两门

相关软件:

  • 全国计算机等级考试模拟软件(2006年全年使用)二级Visual Basic V9.0
  • NeoExam考试系统 大众版/ACCESS数据库 1.0.8
  • NeoExam考试系统 VIP版/ACCESS数据库 1.0.8
  • 主治医师考试宝典(全科) 1.0
  • 主治医师考试宝典(内科) 1.0
  • 主治医师考试宝典(计划生育) 1.0

 

快速导航

  • 网络学院
  • 精品汇聚
  • 字体下载
  • 教程下载
  • 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 第九软件网 版权所有