| 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: -
The code will fail to compile. -
The use of aggregation is justified, since Planet has-a Star . -
The code will fail to compile if the name starName is replaced with the name bodyName throughout the declaration of the Star class. -
The code will fail to compile if the name starName is replaced with the name name throughout the declaration of the Star class. -
An instance of Planet is a valid instance of a HeavenlyBody . |