Kizspy | Question: 32
(Choose 1 answer)
What is the difference between composition and inheritance in Java?
A. Composition is a way to create objects dynamically, while inheritance is a way to reuse code
B. Composition is a way to create objects statically, while inheritance is a way to create objects dynamically
C. Composition is a way to reuse code, while inheritance is a way to create objects dynamically
D. Composition is a way to create objects by combining existing objects, while inheritance is a way to reuse code