| ACCA | CET | EMBA | GMAT | GRE | JAVA认证 | Linux认证 | LSAT | MBA | MPA | Oracle认证 | PETS | TOEIC | 保险资格 | 报关员 | 报检员 | 成人高考 | 城市规划师 | 大学英语 | 导游 | 电子商务师 | 法律硕士 | 房产估价师 | 高级会计师 | 工程硕士 | 公务员 | 国际内审师 | 国际商务师 | 会计硕士 | 会计职称 | 会计资格 | 计算机等级考试 | 监理工程师 | 建造师 | 建筑师 | 结构工程师 | 经济师 | 精算师 | 考试试题 | 考研 | 口译笔译 | 秘书认证 | 人力资源师 | 软件水平考试 | 商务英语 | 实用英语 | 司法考试 | 思科认证 | 同等学历 | 土地估价师 | 托福考试 | 外销员 | 微软认证 | 物流师 | 项目管理师 | 小语种 | 雅思考试 | 在职硕士 | 造价师 | 证券认证 | 执业护士 | 执业药师 | 执业医师 | 职称英语 | 注册会计师 | 注册税务师 | 咨询工程师 | 资产评估师 | 自学考试 |
华夏学习网_JAVA认证_JAVA认证题库_ SCJP模拟试题[2]

SCJP模拟试题[2]

此套试题由60道题组成。

Questions
Question 1)

Which of the following lines will compile without warning or error.

a) float f = 1.3;
b) char c = "a";
c) byte b = 257;
d) boolean b = null;
e) int i = 10;

Question 2)

What will happen if you try to compile and run the following code

public class MyClass {
public static void main(String arguments[])
{
amethod(arguments);
}
public void amethod(String[] arguments)
{
System.out.println(arguments);
System.out.println(arguments[1]);
}
}
1) error Can't make static reference to void amethod.
2) error method main not correct
3) error array must include parameter
4) amethod must be declared with String

answer


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

Question 3)

Which of the following will compile without error

1) import java.awt.*;
package Mypackage;
class Myclass {}

2) package MyPackage;
import java.awt.*;
class MyClass{}

3) /*This is a comment */
package MyPackage;
import java.awt.*;
class MyClass{}

answer

 

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

Question 4)

A byte can be of what size

1) -128 to 127
2) (-2 power 8 )-1 to 2 power 8
3) -255 to 256
4) depends on the Virtual machine

answer


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

Question 5)

What will be printed out if this code is run with the following command line
java myprog good morning

public class myprog{
public static void main(String argv[])

{
System.out.println(argv[2])
}

}

1) myprog
2) good
3) morning
4) Exception raised: "java.lang.ArrayIndexOutOfBoundsException: 2"

answer

 

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

Question 6)

Which of the following are java reserved words

1) if
2) then
3) goto
4) while
5) case

answer


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

Question 7)


Which of the following are legal identifiers

1) 2variable
2) variable2
3) _whatavariable
4) _3_
5) $anothervar
6) #myvar

answer

 

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

Question 8)

What will happen when you compile the following code

public class MyClass{

文章发布:华夏学习网 发布时间:2006-07-16
上一篇:SCJP模拟试题[1]  
下一篇:没有了
版权所有©2004-2008 华夏学习网 edu114.cn. 保留所有权利  ICP许可证编号:京06063949号