black

SCJP程序员认证考试

登录

单项选择题

public static void parse(String str) { 
try { 
float f= Float.parseFloat(str); 
} catch (NumberFormatException nfe) { 
f= 0; 
} finally { 
System.out.println(f); 
} 
} 
public static void main(String[] args) { 
parse(”invalid”); 
} 
What is the result?() 

A. 0.0
B. Compilation fails.
C. A ParseException is thrown by the parse method at runtime.
D. A NumberFormatException is thrown by the parse method at runtime.

相关考题

单项选择题 1. public class GoTest {  2. public static void main(String[] args) {  3. Sente a = new Sente(); a.go();  4. Goban b = new Goban(); b.go();  5. Stone c = new Stone(); c.go();  6. }  7. } 8.  9. class Sente implements Go {  10. public void go() { System.out.println(”go in Sente.”); }  11. }  12.  13. class Goban extends Sente {  14. public void go() { System.out.println(”go in Goban”); }  15. }  16.  17. class Stone extends Goban implements Go { }  18.  19. interface Go { public void go(); }  What is the result?()

多项选择题 public abstract class Shape {  private int x;  private int y;  public abstract void draw();  public void setAnchor(int x, int y) {  this.x = x;  this.y = y;  }  }  Which two classes use the Shape class correctly?()

单项选择题 interface Data { public void load(); }  abstract class Info { public abstract void load(); }  Which class correctly uses the Data interface and Info class?()

All Rights Reserved 版权所有©易学考试网(yxkao.com)

备案号:湘ICP备2022003000号-3