exam questions

Exam 1z0-809 All Questions

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

Exam 1z0-809 topic 1 question 170 discussion

Actual exam question from Oracle's 1z0-809
Question #: 170
Topic #: 1
[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 ""da option?

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

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
6c84cb9
4 months ago
B - (no output) - beacuse: The code attempts to move to a row that doesn't exist in the limited result set. Therefore, it results in no output being printed to the console. If there is an error due to the cursor being out of bounds, it might throw an SQLException, but based on standard JDBC behavior, it just results in no output.
upvoted 1 times
6c84cb9
4 months ago
sorry error
upvoted 1 times
...
...
steefaand
11 months, 2 weeks ago
Selected Answer: A
A is true assuming ""da means -da.
upvoted 1 times
...
duydn
1 year, 3 months ago
Selected Answer: A
to enable assert: -ea to disable assert: -de
upvoted 1 times
steefaand
11 months, 2 weeks ago
It's actually -da (or -disableassertions) to disable assertions
upvoted 1 times
...
...
WilsonKKerll
2 years, 10 months ago
if Option is.-ea , answer is C java.lang.AssertionError. if Option is -da , answer is 10.
upvoted 3 times
...
jduarte
3 years, 11 months ago
Answer is A
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