移动端

  • 题王微信公众号

    题王微信公众号

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

计算机考试 | Java认证考试

科目:

SCJP程序员认证考试

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

模式切换

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

章节目录

单选题 Which is a valid identifier?() 

A

 false

B

 default

C

 _object

D

 a-class

单选题 Which code fragment, inserted at line 23, allows the code to compile?()

A

df = new DateFormat();

B

df = Date.getFormat();

C

df = date.getFormat();

D

df = DateFormat.getFormat();

E

df = DateFormat.getInstance();

单选题 System.out.format(”Pi is approximately %d.”, Math.PI);  What is the result?() 

A

 Compilation fails.

B

 Pi is approximately 3.

C

 Pi is approximately 3.141593.

D

 An exception is thrown at runtime.

多选题 Which two methods, inserted  individually, correctly complete the Three class?()

A

public void foo(){ }

B

public int foo(){return 3;}

C

public Two foo(){return this;}

D

public One foo(){return this;}

E

public Object foo(){return this;}

单选题 public class Foo {   public void main (String args) {   system.out.printIn(“Hello World.”);   }   }   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.

单选题 byte arry1, array2;   byte array3 ;   byte array4;   If each array has been initialized, which statement will cause a compiler error?()

A

 Array2 = array1;

B

 Array2 = array3;

C

 Array2 = array4;

D

 Both A and B

E

 Both A and C

F

 Both B and C

多选题 Which two of statements are true?()

A

It is possible to synchronize static methods.

B

When a thread has yielded as a result of yield(), it releases its locks.

C

When a thread is sleeping as a result of sleep(), it releases its locks.

D

The Object.wait() method can be invoked only from a synchronized context.

E

The Thread.sleep() method can be invoked only from a synchronized context.

F

When the thread scheduler receives a notify() request, and notifies a thread, that thread immediately releases its lock.

多选题 public class MethodOver {   private int x, y;   private float z;   public void setVar(int a, int b, float c){   x = a;   y = b;   z = c;   }   }   Which two overload the setVar method?()

A

 void setVar (int a, int b, float c){  x = a;  y = b;  z = c;  }

B

 public void setVar(int a, float c, int b) {  setVar(a, b, c);  }

C

 public void setVar(int a, float c, int b) {  this(a, b, c);  }

D

 public void setVar(int a, float b){  x = a;  z = b;  }

E

 public void setVar(int ax, int by, float cz) {  x = ax;  y = by;  z = cz;  }

单选题 public class CreditCard {  private String cardlD;  private Integer limit;  public String ownerName;  public void setCardlnformation(String cardlD,  String ownerName, 28. Integer limit) {  this.cardlD = cardlD;  this.ownerName = ownerName;  this.limit = limit;  }  } Which is true?() 

A

 The class is fully encapsulated.

B

 The code demonstrates polymorphism.

C

 The ownerName variable breaks encapsulation.

D

 The cardlD and limit variables break polymorphism.

E

 The setCardlnformation method breaks encapsulation.

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

到第