
238 • Java Programming
1. What is the difference between composition (has-
a) and inheritance (is-a)?
2. What is the difference between overriding and
overloading a method?
3. Describe the syntax of single inheritance in Java.
4. What is inheritance and what are its uses?
5. What are the rules for abstract class?
6. When do we declare a variable, method, or class
fi nal?
7. When do we declare a method or class abstract?
8. Discuss the different level of access protection
with example.
9. Create a base class called Shape, it contain two
methods getxyvalue() and showxyvalue()
for accepting co-ordinates and to displaying ...