Abstract Class&methods
Abstract Class&methods
🔹 Definition:
An abstract class in Java is a class that cannot be instantiated (cannot create an
object of that class directly)
and may contain abstract methods (methods without a body) as well as concrete
methods (methods with a body).
To use an abstract class you have to inherite it from sub class (abstarct class
must be super class)
✅ You want to enforce a common method across all subclasses but with different
implementations.
✅ You don't know the exact implementation yet, but you want to define the method
structure.