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 an abstract class and an interface?

    An abstract class is a partially built parent that can hold state, constructors and shared code, and a class can extend only one. An interface is a contract of methods that a class promises to provide, and a class can implement many.

    IntermediateIn-depth2 min read
  2. How do you achieve abstraction in Java?

    Use abstract classes (partial implementations with abstract methods) or interfaces (pure contracts). Callers depend on the abstract type and never see the concrete class behind it.

    BeginnerQuick answer1 min read