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. Can an abstract class have a constructor? Why would it need one?

    Yes. It cannot be instantiated directly, but a subclass constructor calls it with super() so the parent's fields get initialised.

    IntermediateQuick answer1 min read