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

SCJP Mock Exam 1(4)

 

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

 

 

       

5) The length() method of the StringBuffer class.

Q28
Which statements, when inserted at the indicated position in the following code, will cause a runtime exception when attempting to run the program?

class A {}
class B extends A {}
class C extends A {}
public class Q3ae4 {
public static void main(String args[]) {
A x = new A();
B y = new B();
C z = new C();
// insert statement here
}
}

1) x = y;
2) z = x;
3) y = (B) x;
4) z = (C) y;
5) y = (A) y;

Q29
Which of these are keywords in Java ?

1) default
2) NULL
3) String
4) throws
5) long

Q30
It is desirable that a certain method within a certain class can only be accessed by classes that are defined within the same package as the class of the method. How can such restrictions be enforced?

1) Mark the method with the keyword public.
2) Mark the method with the keyword protected.
3) Mark the method with the keyword private.
4) Mark the method with the keyword package.
5) Do not mark the method with any accessibility modifiers.

Q31
Which code fragments will succeed in initializing a two-dimensional array named tab with a size that will cause the expression tab[3][2] to access a valid element?

CODE FRAGMENT A:
int[][] tab = {
{ 0, 0, 0 },
{ 0, 0, 0 }
};

CODE FRAGMENT B:
int tab[][] = new int[4][];
for (int i=0; i
CODE FRAGMENT C:
int tab[][] = {
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0
};

CODE FRAGMENT D:
int tab[3][2];

CODE FRAGMENT E:
int[] tab[] = { {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0} };

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

Q32
What will be the result of attempting to run the following program?

public class Qaa75 {
public static void main(String args[]) {
String[][][] arr = {
{ {}, null },
{ { "1", "2" }, { "1", null, "3" } },
{},
{ { "1", null } }
};
System.out.println(arr.length + arr[1][2].length);
}
}

1) The program will terminate with an ArrayIndexOutOfBoundsException.
2) The program will terminate with a NullPointerException.
3) 4 will be written to standard output.
4) 6 will be written to standard output.
5) 7 will be written to standard output.

Q33
Which expressions will evaluate to true if preceded by the following code?

String a = "hello";
String b = new String(a);
String c = a;
char[] d = { 'h', 'e', 'l', 'l', 'o' };

1) (a == "Hello")
2) (a == b)
3) (a == c)
4) a.equals(b)
5) a.equals(d)

Q34
Which statements concerning the following code are true?

class A {
public A() {}
public A(int i) { this(); }
}
class B extends A {
public boolean B(String msg) { return false; }
}
class C extends B {
private C() { super(); }
public C(String msg) { this(); }
public C(int i) {}
}

1) The code will fail to compile.
2) The constructor in A that takes an int as an argument will never be called as a result of constructing an object of class B or C.
3) Class C has three constructors.
4) Objects of class B cannot be constructed.
5) At most one of the constructors of each class is called as a result of constructing an object of class C.

Q35
Given two collection objects referenced by col1 and col2, which of these statements are true?

1) The operation col1.retainAll(col2) will not modify the col1 object.
2) The operation col1.removeAll(col2) will not modify the col2 object.
3) The operation col1.addAll(col2) will return a new collection object,
containing elements from both col1 and col2.
4) The operation col1.containsAll(Col2) will not modify the col1 object.

Q36
Which statements concerning the relationships between the following classes are true?

 

 

 

上下文章:

 

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

相关文章:

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