TOPIC-WISE INTERVIEW PRACTICE

Object-Oriented Programming interview questions and quick answers

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

Review 889 questions and short answers on Object-Oriented Programming. Start with real examples below, then search, practise and follow links to full explanations.

889 questionsFree revision22 topics
START HERE

Object-Oriented Programming: questions worth revising first

These answers come from AI Tapri's existing question bank and published interview guides. Open each answer and read the linked in-depth guide for examples and context.

01Can 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.

Read the full explanation
02What 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.

Read the full explanation
03What is the difference between abstraction and encapsulation?

Abstraction decides what to show: it exposes a simple view and hides complexity. Encapsulation decides how to protect: it bundles data with methods and restricts access to it.

Read the full explanation
04Are constructors and private members inherited in Java?

Constructors are never inherited; a child must define its own and call the parent's with super(). Private members exist inside the child object but cannot be accessed by name from the child.

Read the full explanation
05Can static methods be overridden in Java?

No. A static method in a child with the same signature hides the parent's one. The call is resolved at compile time from the reference type, so there is no runtime polymorphism.

Read the full explanation
06What is the difference between a class and an object?

A class is a blueprint that describes the fields and methods something will have. An object is one real instance built from that blueprint, with its own values stored in memory.

Read the full explanation
07What is a common pitfall related to "Can an abstract class have a constructor? Why would it need one"?

Saying abstract classes cannot have constructors because they cannot be instantiated.

Read the full explanation
08How would you explain "Can an abstract class have a constructor? Why would it need one" in an interview?

"Yes, abstract classes have constructors, used through super() to initialise shared fields. The class cannot be instantiated on its own, but its constructor runs whenever a concrete subclass object is built."

Read the full explanation
YOUR PRACTICE SPACE

Find your next answer.

Pick a topic, search a keyword, or open a question to reveal the answer.

889 questions available
OBJECT-ORIENTED PROGRAMMING

Object-Oriented Programming quick answers

Showing 18 of 889
871 remaining

Free to practise. No account needed. Made for quick revision, not rote memorisation.

Keep preparing for Object-Oriented Programming

Quick answers help with recall; detailed guides explain the reasoning, examples and common mistakes behind each answer.

More topics to practise