Interface and Abstract Class
Similarities:
The only similarity between Interface and Abstract class is that both can not be instantiated.
Differences:
Similarities:
The only similarity between Interface and Abstract class is that both can not be instantiated.
Differences:
- An abstract class can have methods with implementation, to provide some default behavior.An interface can not have any implementation.
- All the variables in the interface are final by default. An abstract class can have non-final methods.
- All the methods in an interface are public by default. An abstract class can have protected and ...
- If we want to implement an interface we would use implements. For an abstract class we would use extends.
No comments:
Post a Comment