6.27 |
Given the following code, which statements are true? public interface HeavenlyBody { String describe(); } class Star { String starName; public String describe() { return "star " + starName; } } class Planet extends Star { String name; public String describe() { return "planet " + name + " orbiting star " + starName; } } Select the two correct answers:
|
6.28 |
Given the following code, which statement is true? public interface HeavenlyBody { String describe(); } class Star implements HeavenlyBody { String starName; public String describe() { return "star " + starName; } } class Planet { String name; Star orbiting; public String describe() { return "planet " + name + " orbiting " + orbiting.describe(); } } Select the one correct answer:
|