exam questions

Exam 1z0-819 All Questions

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

Exam 1z0-819 topic 1 question 142 discussion

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

Given:



What is the result?

  • A. Hello
  • B. NullPointerException is thrown at line 4
  • C. NullPointerException is thrown at line 10
  • D. A compilation error occurs
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

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
c47d39c
6 months, 1 week ago
Answer A..Even though c is null, greet is a static method. In Java, static methods belong to the class, not instances of the class, so they can be called on the class itself or on a null reference to the class.
upvoted 1 times
...
cathDev
9 months, 4 weeks ago
Selected Answer: A
Tested A
upvoted 1 times
...
ASPushkin
10 months, 1 week ago
Selected Answer: A
c.greet() with empty argument produce args = String[0] loop is not executed Main c = null; c.greet(); The access to static members is allowed through instances of the class that defines them. The value of the instance doesn't matter. it could be null.
upvoted 2 times
...
d7bb0b2
1 year ago
Selected Answer: A
A is correct, if line 7 (<span> is not considered) because String ... args generate a empty string by default.so if you no send arguments is an empty array. foreach dont print anything
upvoted 1 times
...
Samps
1 year, 1 month ago
D is correct,due to the error in line 7. Correct line 7 then the answer becomes A.
upvoted 1 times
...
Omnisumem
1 year, 3 months ago
Selected Answer: D
Tested: D.
upvoted 2 times
...
Stavok
1 year, 6 months ago
Selected Answer: D
D is correct,due to the error in line 7
upvoted 2 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