black

SCJP程序员认证考试

登录

单项选择题

public class Test { 
public static void main(String[] args) { 
int x = 0; 
assert (x > 0): “assertion failed”; 
System.out.println(“finished”); 
} 
} 
What is the result?()  

A. finished
B. Compilation fails.
C. An AssertionError is thrown.
D. An AssertionError is thrown and finished is output.

相关考题

单项选择题 classSuper{publicintgetLenght(){return4;}}publicclassSubextendsSuper{publiclonggetLenght(){return5;}publicstaticvoidmain(String[]args){Supersooper=newSuper();Subsub=newSub();System.out.println(sooper.getLenght()+“,”+sub.getLenght());}}Whatistheoutput?()

单项选择题 public void test(int x) {  int odd = x%2;  if (odd) {   System.out.println(“odd);  } else {  System.out.println(“even”);  }  }  Which statement is true?()

单项选择题 class Super {  public int getLenght() { return 4; }  }  public class Sub extends Super {  public long getLenght() { return 5; }  public static void main(String[] args) {  Super sooper = new Super();  Sub sub = new Sub();  System.out.println(  sooper.getLenght() + “,” + sub.getLenght() );  }  } What is the output?()

All Rights Reserved 版权所有©求知题库网库(csqiuzhi.com)

备案号:湘ICP备14005140号-1

经营许可证号:湘B2-20140064