1How are assertions enabled when running a program?ABy importing java.lang.assertBThey are always enabledCWith the -ea (or -enableassertions) JVM flagDWith the -assert flag at compile timeView AnswerDiscussWorkspaceReportSaveEasy
2Can you catch an AssertionError?AOnly in mainBYes, but it is usually not recommendedCNoDOnly with finallyView AnswerDiscussWorkspaceReportSaveEasy
3What is the correct syntax for an assertion with a message?Aassert(x > 0, "msg");Bassert x > 0 : "x must be positive";Cassert x > 0, "msg";Dassertion x > 0 : msg;View AnswerDiscussWorkspaceReportSaveEasy
4By default, Java assertions are:ACompiled awayBAlways enabledCErrorsDDisabled at run timeView AnswerDiscussWorkspaceReportSaveEasy
5What happens when an enabled assertion fails?AAn Exception is returnedBThe JVM exits with code 0CAn AssertionError is thrownDA warning is printed and execution continuesView AnswerDiscussWorkspaceReportSaveEasy