exam questions

Exam 1z0-819 All Questions

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

Exam 1z0-819 topic 1 question 95 discussion

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

Given:



Which two changes need to be made to make this class compile? (Choose two.)

  • A. Change Line 1 to a class:
    public class API {
  • B. Change Line 2 to an abstract method:
    public abstract void checkValue(Object value)
    throws IllegalArgumentException;
  • C. Change Line 2 access modifier to protected:
    protected void checkValue(Object value)
    throws IllegalArgumentException;
  • D. Change Line 1 to extend java.lang.AutoCloseable:
    public interface API extends AutoCloseable {
  • E. Change Line 1 to an abstract class:
    public abstract class API {
Show Suggested Answer Hide Answer
Suggested Answer: BE 🗳️

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
ASPushkin
6 months, 3 weeks ago
Selected Answer: BE
answer: EB The second method (isValueANumber) cannot be changed and it is a full method. This implies the need for a class in the header (A or E) If the header is E (public abstract class API), then the first method (checkValue) must be abstract or a full (with body). There is just abstract case (B). For the case A the first method (checkValue) must be a full (with body). There is no such a possibility.
upvoted 1 times
ASPushkin
2 months ago
Double. public static double parseDouble(String s) throws NumberFormatException and NullPointerException NullPointerException extends RuntimeException so evrthing is fine
upvoted 1 times
...
...
d7bb0b2
1 year ago
Selected Answer: BE
NEED TWO OPTIONS FOR COMPILATION
upvoted 1 times
...
dilleman
1 year, 3 months ago
Selected Answer: BE
B and E, tested
upvoted 1 times
...
Stavok
1 year, 5 months ago
Selected Answer: BE
B AND E ARE CORRECT,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