Java Question - Based on code, which answer out of the choices "A, B, C, D, E" is correct. Question has one correct answer. Thank you. Part 2 - 10. Given the following code, which statement is true? class Water() { ... } class Juice() extends Water { ... } class Apple() { ... } class ApplePie() { Apple a1 = new Apple(); } class AppleJuice() { Apple a1 = new Apple(); Water w1 = new Water(); } A. Juice is a superclass and Water is a subclass. B. ApplePie is a superclass of Apple. C. ApplePie is a composite class that contains an instance of Apple class. D. AppleJuice is a superclass that contains an instance of Apple class and an instance of Water. E. Water is a composite class that contains an instance of Juice.5
Java Question - Based on code, which answer out of the choices "A, B, C, D, E" is correct. Question has one correct answer. Thank you.
Part 2 - 10. Given the following code, which statement is true?
class Water() { ... }
class Juice() extends Water { ... }
class Apple() { ... }
class ApplePie() { Apple a1 = new Apple(); }
class AppleJuice() { Apple a1 = new Apple(); Water w1 = new
Water(); }
A. Juice is a superclass and Water is a subclass.
B. ApplePie is a superclass of Apple.
C. ApplePie is a composite class that contains an instance of Apple class.
D. AppleJuice is a superclass that contains an instance of Apple class and an instance of Water.
E. Water is a composite class that contains an instance of Juice.5

Trending now
This is a popular solution!
Step by step
Solved in 2 steps









