Q1.
What is the main purpose of encapsulation in Java?
Q2.
Which access modifier is commonly used to achieve encapsulation in Java?
Q3.
How can external classes access encapsulated data in Java?
Q4.
Which of the following best demonstrates encapsulation?
Q5.
What will happen if a class has private variables but no getters or setters?
