exam questions

Exam 1z0-809 All Questions

View all questions & answers for the 1z0-809 exam

Exam 1z0-809 topic 1 question 4 discussion

Actual exam question from Oracle's 1z0-809
Question #: 3
Topic #: 2
[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);
}
}
ea option?
What is the result of running the code with the

  • A. -10
  • B. 0 AssertionError is thrown.
  • C. An
  • D. A compilation error occurs.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Pasci
2 weeks, 3 days ago
when run with java –ea: B when run without ea option: A
upvoted 4 times
...
Destroyer
7 months, 1 week ago
AssertionError is thrown without 0
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago