I was going through the concepts of abstraction in Java.
These are my understandings:
- Abstraction is the method of presenting the signature of functions and hiding the implementation, leaving it to the users who can implement/extend the interface/abstract class.
- This way we can achieve greater scope for less modification of code, re-usability.
- We can closely relate the objects in real time to objects in program code.
These are my questions:
When an abstract class can behave like an interface when all the methods are made abstract, why do we need interface separately? Please explain with an example for better understanding.
Can we likely call Abstract class = Interface + Inheritance on a functionality basis? Because we can achieve the functionality of interface and inheritance together with Abstract class.