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 92 discussion

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

Given:

What is the result?

  • A. IT:null
  • B. A NullPointerException is thrown at run time.
  • C. A compilation error occurs.
  • D. IT:0.0
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
pul26
Highly Voted 3 years, 4 months ago
Answer is B
upvoted 5 times
...
asdfjhfgjuaDCV
Most Recent 1 month, 2 weeks ago
B is the answer
upvoted 1 times
...
steefaand
2 months, 2 weeks ago
Selected Answer: B
Answer is B, tested, NPE happens since Supplier provides null.
upvoted 1 times
...
WilsonKKerll
2 years, 1 month ago
Selected Answer: B
NullPointerExcepiton
upvoted 4 times
...
Tarik2190
2 years, 11 months ago
Answer is B, class Job { String name; Integer cost; Job(String name, Integer cost) { this.name = name; this.cost = cost; } public String getName() { return name; } public int getCost() { return cost; } } public class Test { public static void main (String[] args) throws InterruptedException, ExecutionException { Job j1 = new Job("IT", null); DoubleSupplier dS = j1::getCost; System.out.println(j1.getName() + ": " + dS.getAsDouble()); } }
upvoted 1 times
...
Svetleto13
2 years, 11 months ago
B,tested.If we replace Integer(object) with int(primitive) answer is D.
upvoted 1 times
...
JME_CHG
3 years ago
When I change int getCost() to Integer getCost() I thought DoubleSupplier line would fail compilation but it continued to work, anyone know why?
upvoted 1 times
hmcbq
3 years ago
I think that int can't be null because it is primitive. But Integer is an object.
upvoted 2 times
...
...
Chiraj
3 years, 2 months ago
The answer is B tested.
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 ...