Given the following code for a Planet object: What is the output?
A.
Option C
B.
Option D
C.
Option A
D.
Option B
E.
Option E
Explanation:
Given the following code for a Planet object: What is the output?
A.
Option C
B.
Option D
C.
Option A
D.
Option B
E.
Option E
Explanation:
A
Option C
A – Option C
Definitely A – Option C.
Answer: A (Option C)
output:
[Lexam.Planet2;@2a139a55
exam.Planet2@15db9742
1
a
Answer: A (Option C)
To print array you should use java.util.Arrays.toString(planets), and to print one specific planet in readable format, class (Planet) should override toString() method