OOP for Javas
Java OOP covers how classes relate to each other through inheritance, interfaces, abstract classes, polymorphism, records and enums. It sits in the Language stage after the basics and teaches how to model a problem as cooperating types, which is the main design style used across the Java platform.
Stage: Language · Part of the Java roadmap · Last reviewed 19 November 2026
What to learn in OOP
- Extend a class and override a method using the @Override annotation
- Design an interface and provide two implementations that callers use interchangeably
- Choose between an abstract class and an interface for a given design
- Declare a record to hold immutable data without writing boilerplate
- Model a fixed set of values with an enum that carries fields and methods
OOP interview questions
What is the difference between an abstract class and an interface in Java?
A class can implement many interfaces but extend only one class. Abstract classes can hold state and constructors. Interfaces describe a contract, and since Java 8 can include default and static methods. Use an interface for capability, an abstract class for shared base behaviour.
What is a Java record and when would you use one?
A record is a compact class for immutable data. The compiler generates the constructor, accessors, equals, hashCode and toString from the declared components. Use it for value carriers such as DTOs or query results, where identity does not matter and fields never change.
Where OOP fits in the Java roadmap
OOP belongs to the Language stage (beginner level), which takes about 32 hours. Syntax and OOP.