Oracle
1Z0-850 · Question #18
1Z0-850 Question #18: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-850 to reveal the answer and full explanation for question #18. The question stem and answer options stay visible for context.
Question
Given:
14. class Dog {
15. String name;
16. public static void main(String [] args) {
17. Dog d1 = new Dog();
18. Dog d2 = new Dog();
19. d1.name = "Aiko";
20. d2.name = "Aiko";
21. if (d1 == d2) System.out.println("== ");
22. if (d1.equals(d2)) System.out.println("dot =");
23. }
24. }
What is the result?
Options
- A== dot =
- BCompilation fails.
- Cdot =
- DNo output is produced.
- E==
Unlock 1Z0-850 to see the answer
You've previewed enough free 1Z0-850 questions. Unlock 1Z0-850 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.