exam questions

Exam 1z0-809 All Questions

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

Exam 1z0-809 topic 1 question 72 discussion

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

Given:
class RateOfInterest {
public static void main (String[] args) {
int rateOfInterest = 0;
String accountType = "LOAN";
switch (accountType) {
case "RD";
rateOfInterest = 5;
break;
case "FD";
rateOfInterest = 10;
break;
default:
assert false: "No interest for this account"; //line n1
}
System.out.println ("Rate of interest:" + rateOfInterest);
}
}
and the command:
java ""ea RateOfInterest
What is the result?

  • A. Rate of interest: 0
  • B. An AssertionError is thrown.
  • C. No interest for this account
  • D. A compilation error occurs at line n1.
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
adnano1234
Highly Voted 4 years, 6 months ago
Exception in thread "main" java.lang.AssertionError: No interest for this account
upvoted 10 times
...
shivkumarx
Most Recent 3 months, 2 weeks ago
Selected Answer: B
Answer is definitely B, the people who said A are not running the java with assertions enabled
upvoted 1 times
...
asdfjhfgjuaDCV
4 months, 1 week ago
B is the correct answer
upvoted 1 times
...
steefaand
5 months, 1 week ago
Selected Answer: B
Assuming that "" is typo and it means - answer is B.
upvoted 1 times
...
iSnover
5 months, 3 weeks ago
Selected Answer: A
The answer is A, because the command in parentheses (java ""ea Rate Of Interest) does not enable assertions, but rather the command "java -ea RateOfInterest", if the command were typed correctly it would be letter B
upvoted 1 times
...
samtash1034
2 years, 6 months ago
B,test
upvoted 3 times
...
tamanna786
2 years, 9 months ago
Answer: A, tested
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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago