Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Oracle Exam 1Z0-809 Topic 8 Question 28 Discussion

Actual exam question for Oracle's 1Z0-809 exam
Question #: 28
Topic #: 8
[All 1Z0-809 Questions]

Given:

public class Counter {

public static void main (String[ ] args) {

int a = 10;

int b = -1;

assert (b >=1) : ''Invalid Denominator'';

int = a / b;

System.out.println (c);

}

}

What is the result of running the code with the --ea option?

Show Suggested Answer Hide Answer
Suggested Answer: D

Contribute your Thoughts:

Nicholle
11 days ago
Wait, the denominator is negative? That's not going to work. I'll have to go with C, AssertionError.
upvoted 0 times
...
Ranee
13 days ago
Hah, divide by zero? That's a classic! I bet it'll throw some kind of error. I'll go with C, AssertionError.
upvoted 0 times
...
Merissa
17 days ago
Oh no, the denominator is negative! This is going to end in disaster. I'll go with C - An AssertionError is thrown.
upvoted 0 times
Yolande
3 days ago
C) An AssertionError is thrown.
upvoted 0 times
...
...
Tonja
26 days ago
I'm not sure, but I think D) A compilation error occurs because of the assert statement.
upvoted 0 times
...
Ming
27 days ago
I believe the correct answer is A) -10 because b is -1.
upvoted 0 times
...
Bev
1 months ago
I think the answer is C) An AssertionError is thrown.
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77