What is abstraction in Java?

Abstraction is an Object-Oriented Programming (OOP) concept that focuses on exposing only the essential features of an object while hiding the internal implementation details. It allows developers to define what an object can do without revealing how it performs those operations.

Key Points

Example

When driving a car, you use the steering wheel, accelerator, and brakes without knowing the internal workings of the engine. The car exposes only the necessary controls while hiding the complex implementation.

abstract class Vehicle {

    abstract void start();

    void stop() {
        System.out.println("Vehicle Stopped");
    }
}

class Car extends Vehicle {

    @Override
    void start() {
        System.out.println("Car Started");
    }
}

public class Demo {

    public static void main(String[] args) {

        Vehicle vehicle = new Car();

        vehicle.start();
        vehicle.stop();
    }
}

Output

Car Started

Vehicle Stopped

How Java Supports Abstraction

1. Abstract Class

2. Interface

Benefits of Abstraction

Interview Tip

A concise interview answer is

Abstraction is the process of hiding implementation details and exposing only essential functionality. It allows users to focus on what an object does rather than how it does it. In Java, abstraction is implemented using abstract classes and interfaces.

Last updated: 11 November 2026

Previous question: Can constructors be polymorphic?

Next question: Can you provide examples of where abstraction is effectively used in Java libraries?

More Core Java - Level II interview questions

All Core Java - Level II questions