移动端

  • 题王微信公众号

    题王微信公众号

    微信搜“题王网”真题密题、最新资讯、考试攻略、轻松拿下考试

计算机考试 | Java认证考试

科目:

SCJP程序员认证考试

[切换]
题库
练习
考试
资讯

模式切换

0 0 0
我的错题 我的收藏 学习笔记

章节目录

单选题 System.out.println(Math.sqrt(-4D));  What is the result?()  

A

 –2

B

 NaN

C

 Infinity

D

 Compilation fails.

E

 An exception is thrown at runtime.

单选题 public class Test {   public static void main (String args) {  string foo = “blue”;  string bar = foo;   foo = “green”;   System.out.printIn(bar);   }   }   What is the result?()  

A

 An exception is thrown.

B

 The code will not compile.

C

 The program prints “null”

D

 The program prints “blue”

E

 The program prints “green”

单选题 Given two files, GrizzlyBear.java and Salmon.java: If both classes are in the correct directories for their packages, and the Mammal class correctly defines the findSalmon() method, which change allows this code to compile?()

A

add import animals. mammals.*; at line 2 in Salmon.java

B

add import animals.fish.*; at line 2 in GrizzlyBearjava

C

add import animals.fish.Salmon.*; at line 2 in GrizzlyBear.java

D

add import animals. mammals.GrizzlyBear*; at line 2 in Salmon.java

单选题 int x = 1, y =6;  while (y--) {  x++;  }  System.out.println(“x =” + x + “y =” +y); What is the result?()  

A

 x = 6 y = 0

B

 x = 7 y = 0

C

 x = 6 y = -1

D

 x = 7 y = -1

E

 Compilation fails.

单选题 What is the result?()

A

Compilation fails.

B

After line 15, the value of age is 5.

C

After line 15, the value of age is 3.

D

An exception is thrown at runtime.

单选题 Given:  310-025   Leading the way in IT testing and certification tools, www.testking.com   - 48 -   public class foo {   static String s;   public static void main (Stringargs) {   system.out.printIn (“s=” + s);   }   }   What is the result?()

A

 The code compiles and “s=” is printed.

B

 The code compiles and “s=null” is printed.

C

 The code does not compile because string s is not initialized.

D

 The code does not compile because string s cannot be referenced.

E

 The code compiles, but a NullPointerException is thrown when toString is called.

单选题 int i= 1, j= 10 ;   do (   if (i++> --j) continue;  ) while (i<5);   After execution, what are the values for I and j? ()

A

 i = 6 and j= 5

B

 i = 5 and j= 5

C

 i = 6 and j= 4

D

 i = 5 and j= 6

E

 i = 6 and j= 6

首页 上一页 1 2 3 4 5 下一页 尾页 /

到第