Java OOP Concepts Worksheet
Section 1: Fill in the Blanks
1. __________ is the process of wrapping data and code into a single unit.
2. __________ allows a class to acquire properties of another class.
3. __________ allows one interface to be used for a general class of actions.
4. __________ means hiding the internal details and showing only the functionality.
5. The keyword used to inherit a class is __________.
Section 2: True or False
1. A private variable can be accessed directly outside its class. (True/False)
2. The `super` keyword is used to call the parent class constructor. (True/False)
3. Polymorphism is only achieved through method overloading. (True/False)
4. Abstraction and encapsulation are unrelated concepts. (True/False)
5. Java supports multiple inheritance through interfaces. (True/False)
Section 3: Short Answer Questions
1. What is the difference between method overloading and method overriding?
2. Explain encapsulation with a real-life example.
3. Write a simple class with one private attribute and getter/setter methods.
4. How does abstraction improve code security and readability?
5. What are the advantages of using OOP in software development?