Interview Q&A / Object-Oriented Programming

INTERVIEW Q&A · 69 QUESTIONS

Object-Oriented Programming interview questions

The four pillars, interfaces, abstract classes and design basics.

  1. What is the difference between protected and default (package-private) access in Java?

    Default access lets only classes in the same package use the member. Protected allows the same package plus subclasses in any package, but through inheritance.

    IntermediateQuick answer1 min read