6Which command-line flag disables assertions?A-daB-xaC-noassertD-eaView AnswerDiscussWorkspaceReportSaveEasy
7What is the correct syntax for an assertion with a message?Aassert x > 0 : "x must be positive";Bassertion x > 0 : msg;Cassert(x > 0, "msg");Dassert x > 0, "msg";View AnswerDiscussWorkspaceReportSaveEasy
8How are assertions enabled when running a program?AThey are always enabledBBy importing java.lang.assertCWith the -assert flag at compile timeDWith the -ea (or -enableassertions) JVM flagView AnswerDiscussWorkspaceReportSaveEasy
9Which of these is a valid assert statement?Aassert count >= 0 , "count is negative";Bassert: count >= 0;Cassert(count >= 0, "count is negative");Dassert count >= 0 : "count is negative";View AnswerDiscussWorkspaceReportSaveEasy
10Should an assert expression have side effects?AYes, it is fasterBOnly for I/OCOnly for countersDNo — the program would behave differently when assertions are offView AnswerDiscussWorkspaceReportSaveEasy