1Z0-852 Web TestEngine demo

Exit VCEDump 1Z0-852 Java Standard Edition 6 Programmer Certified Professional Upgrade
Question 15 of 15
0% complete
Q15 Single choice

Given:

1. public class Donkey2 {
2. public static void main(String[] args) {
3. boolean assertsOn = true;
4. assert (assertsOn) : assertsOn = true;
5. if(assertsOn) {
6. System.out.println("assert is on");
7. }
8. }
9. }

If class Donkey is invoked twice, the first time without assertions enabled, and the second timewith assertions enabled, what are the results?

Sign in to mark questions

Sign in to save marked questions and return to this demo.

Sign in