- It is a contract that specifies the methods a class must implement without providing the implementation details.
- Example: An
Animal
interface may have methods likeeat()
andsleep()
, and classes likeDog
andCat
can implement these methods differently.
Leave a Reply