Independence Day Deal! Unlock 25% OFF Today – Limited-Time Offer - 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:

Cheryl
1 months ago
Divide by negative one? What is this, amateur hour? I'm going with C - AssertionError, and then I'm going to write a stand-up routine about it.
upvoted 0 times
...
Merilyn
2 months ago
Whoa, negative denominator? That's a bold move, let's see how this plays out. I'm gonna go with C, AssertionError.
upvoted 0 times
James
3 days ago
User1
upvoted 0 times
...
Essie
22 days ago
User3
upvoted 0 times
...
Johana
1 months ago
User2
upvoted 0 times
...
...
Nicholle
2 months ago
Wait, the denominator is negative? That's not going to work. I'll have to go with C, AssertionError.
upvoted 0 times
Martin
4 days ago
User2: Got it, thanks for the explanation.
upvoted 0 times
...
Charlene
6 days ago
User1: Yes, it will throw an error because of the negative denominator.
upvoted 0 times
...
Nickole
7 days ago
User2: So the code won't run properly?
upvoted 0 times
...
Mozelle
8 days ago
User1: You're right, a negative denominator will throw an AssertionError.
upvoted 0 times
...
Ben
9 days ago
User1: Exactly, it's an invalid operation.
upvoted 0 times
...
Lashawnda
26 days ago
User3: That makes sense, we can't divide by a negative number.
upvoted 0 times
...
Shonda
1 months ago
User2: So, the code will throw an AssertionError when run with the --ea option.
upvoted 0 times
...
Lezlie
2 months ago
User1: Yeah, a negative denominator will definitely cause an AssertionError.
upvoted 0 times
...
...
Ranee
2 months 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
2 months 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
Pilar
2 months ago
C) An AssertionError is thrown.
upvoted 0 times
...
Yolande
2 months ago
C) An AssertionError is thrown.
upvoted 0 times
...
...
Tonja
3 months ago
I'm not sure, but I think D) A compilation error occurs because of the assert statement.
upvoted 0 times
...
Ming
3 months ago
I believe the correct answer is A) -10 because b is -1.
upvoted 0 times
...
Bev
3 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