Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam 1z0-809 topic 1 question 111 discussion

Actual exam question from Oracle's 1z0-809
Question #: 111
Topic #: 1
[All 1z0-809 Questions]

Given:
and the command: java Product 0
What is the result?

  • A. An AssertionError is thrown.
  • B. A compilation error occurs at line n1.
  • C. New Price: 0.0
  • D. A NumberFormatException is thrown at run time.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
jduarte
Highly Voted 3 years ago
Answer C because the command haven´t -ea
upvoted 7 times
...
steefaand
Most Recent 2 months, 2 weeks ago
Selected Answer: C
C is correct since program isnt run with -ea or -enableassertions and assert statement is skipped.
upvoted 1 times
...
duydn
7 months, 1 week ago
Selected Answer: C
C is correct because we don't enable assert
upvoted 1 times
...
lchowen
1 year, 7 months ago
the assert keyword is disabled by default. To enable the assert you need to provide the "-ea" option when running java command. In this case the assert line wouldn't be evaluated. Answer is C
upvoted 1 times
...
mevlt
2 years, 1 month ago
Answer is A. assert runs where the result is false. When it is true, it will continue from the next line.
upvoted 2 times
mevlt
2 years, 1 month ago
btw it is tested.
upvoted 1 times
...
...
JME_CHG
3 years, 1 month ago
A, 0.0 > 0 is false
upvoted 3 times
Huim
2 years, 11 months ago
is no problem, answer is C.
upvoted 1 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 ...