What is class , abstract class & interface .
Published: (December 11, 2025 at 12:35 AM EST)
1 min read
Source: Dev.to
Source: Dev.to

What is class ?
- A class is a blueprint from which we create objects.
- We declare a class with the
classkeyword. - Inside the class we can directly write fields (non‑static / static), blocks (non‑static / static), constructors, concrete methods (non‑static / static), inner classes, interfaces, and so on.
- Generally, we create an object of a class with the
newkeyword. - A class is also a user‑defined data type.
- We cannot write abstract methods inside a normal class.

Abstract Class
- An abstract class is declared with the
abstractkeyword. - We cannot create an object of an abstract class.
- An abstract class may contain:
- Non‑abstract (concrete) methods
- Abstract methods
- Non‑static fields
- Static fields
- An abstract class cannot be
final.
Note
- An abstract method has no body; its implementation must be provided in a subclass.

Interface
- An interface is a blueprint that contains abstract methods and constant (
public static final) variables. - We declare an interface with the
interfacekeyword. - Using interfaces we can achieve multiple inheritance.
