6.assertions-java2learn.docVIP

  • 8
  • 0
  • 约3.17千字
  • 约 2页
  • 2017-06-05 发布于天津
  • 举报
6.assertions-java2learn

Q: 01 Given: 8. public class test 9. public static void main String [] a 10. assert a.length 1; 11. ? 12. Which two will produce an AssertionError? Choose two. A. java test B. java -ea test C. java test file1 D. java -ea test file1 E. java -ea test file1 file2 F. java -ea:test test file1 Answer: B, E Q: 02 Given a method that must ensure that its parameter is not null: 11. public void someMethod Object value 12. // check for null value ... 20. System.out.println value.getClass ; 21. What, inserted at line 12, is the appropriate way to handle a null value? A. assert value

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档