Java important interview questions
12. Describe the access modifiers in Java. Public: Accessible everywhere. Protected: Accessible within the same package and subclasses. Default: Accessible within the same package only. Private: Accessible within the same class only. 13. What is encapsulation? How is it implemented in Java? Encapsulation is bundling data (variables) and methods into a single unit (class). […]