多做题,通过考试没问题!

Java认证考试

睦霖题库>其他计算机考试>Java认证考试

public class AssertStuff {  public static void main(String [] args) {  int x= 5;  int y= 7;  assert (x> y): “stuff”;  System.out.println(”passed”);  }  }  And these command line invocations:java AssertStuff java -ea AssertStuff What is the result?()

  • A、 passed stuff
  • B、 stuff passed
  • C、 passed      An AssertionError is thrown with the word “stuff” added to the stack trace.
  • D、 passed      An AssertionError is thrown without the word “stuff” added to the stack trace.
  • E、 passed      An AssertionException is thrown with the word “stuff” added to the stack trace.
  • F、 passed     An AssertionException is thrown without the word “stuff” added to the stack trace.
正确答案:C
答案解析:
进入题库查看解析

微信扫一扫手机做题