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

SCJP Mock Exam 1(8)

 

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

 

 

       

1) FileOutputStream has no constructors matching the given arguments.
2) An IOExeception will be thrown if a file named "data" already exists.
3) An IOExeception will be thrown if a file named "data" does not already exist.
4) If a file named "data" exists, its contents will be reset and overwritten.
5) If a file named "data" exists, output will be appended to its current contents.

Q60
Given the following code, write a line of code that, when inserted at the indicated location, will make the overriding method in Extension invoke the overridden method in class Base on the current object.

class Base {
public void print() {
System.out.println("base");
}
}
class Extention extends Base {
public void print() {
System.out.println("extension");
// insert line of implementation here
}
}
public class Q294d {
public static void main(String args[]) {
Extention ext = new Extention();
ext.print();
}
}

Fill in a single line of implementation.

 

Q61
Given that file is a reference to a File object that represents a directory, which code fragments will succeed in obtaining a list of the entries in the directory?

1) Vector filelist = ((Directory) file).getList();
2) String[] filelist = file.directory();
3) Enumeration filelist = file.contents();
4) String[] filelist = file.list();
5) Vector filelist = (new Directory(file)).files();

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

public class Q03e4 {
public static void main(String args[]) {
String space = " ";
String composite = space + "hello" + space + space;
composite.concat("world");
String trimmed = composite.trim();
System.out.println(trimmed.length());
}
}

1) 5
2) 6
3) 7
4) 12
5) 13

Q63
Given the following code, which statements concerning the objects referenced through the member variables i, j and k are true, given that any thread may call the methods a, b and c at any time?

class Counter {
int v = 0;
synchronized void inc() { v++; }
synchronized void dec() { v--; }
}

public class Q7ed5 {
Counter i;
Counter j;
Counter k;
public synchronized void a() {
i.inc();
System.out.println("a");
i.dec();
}
public synchronized void b() {
i.inc(); j.inc(); k.inc();
System.out.println("b");
i.dec(); j.dec(); k.dec();
}
public void c() {
k.inc();
System.out.println("c");
k.dec();
}
}

1) i.v is guaranteed always to be 0 or 1.
2) j.v is guaranteed always to be 0 or 1.
3) k.v is guaranteed always to be 0 or 1
4) j.v will always be greater than or equal to k.v at any give time.
5) k.v will always be greater than or equal to j.v at any give time.

Q64
Which statements concerning casting and conversion are true?

1) Conversion from int to long does not need a cast.
2) Conversion from byte to short does not need a cast.
3) Conversion from float to long does not need a cast.
4) Conversion from short to char does not need a cast.
5) Conversion from boolean to int using a cast is not possible.

Q65
Given the following code, which method declarations, when inserted at the indicated position, will not cause the program to fail compilation?

public class Qdd1f {
public long sum(long a, long b) { return a + b; }
// insert new method declaration here
}

1) public int sum(int a, int b) { return a + b; }
2) public int sum(long a, long b) { return 0; }
3) abstract int sum();
4) private long sum(long a, long b) { return a + b; }
5) public long sum(long a, int b) { return a + b; }

Q66
The 8859-1 character code for the uppercase letter A is 65. Which of these code fragments declare and initialize a variable of type char with this value?

1) char ch = 65;
2) char ch = '65';
3) char ch = '041';
4) char ch = 'A';
5)char ch = "A";


1) 4
2) 2
3) 2
4) 2, 6
5) 4
6) 3
7) 4
8) 4
9) 1, 2, 3, 5
10) 1, 5
11) 4
12) 5
13) 1
14) "LayoutManager layout = new GridLayout(2, 3);"
or: "LayoutManager layout = new GridLayout(2, 3)"
15) 5
16) 3
17) 2, 4
18) 4, 5
19) 2
20) 4
21) 4
22) 5
23) 1, 2
24) 2
25) 1, 4
26) 3
27) 4
28) 3 (? no run-time exception)
29) 1, 4, 5
30) 5
31) 2, 5
32) 1
33) 3, 4
34) 2, 3
35) 2, 4
36) 3, 5
37) 2, 5
38) 3, 4
39) 1
40) 1, 2, 3
41) "wait"
42) 3
43) 3
44) 5
45) 4
46) 1, 2, 3, 4
47) 2
48) 1, 2, 4
49) 1
50) 2, 3
51) 1, 5
52) 1, 3
53) 1
54) 2, 5
55) 5
56) 2, 3
57) 4
58) 2, 3
59) 5
60) super.print();
61) 4
62) 1
63) 1,2
64) 1,2,5
65) 1,5
66) 1,4

 

 

 

上下文章:

 

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

相关文章:

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