|
Interface |
Abstract Class |
|
1. Use interface when we have specification but don’t have any idea about implementation |
1.Use it when we have partial information about implementation |
|
2. Abstract methods only. From java 8 default and static methods also |
2. have both abstract and non-abstract methods |
|
3. Every variable is public , static and final |
|
|
4. No constructors allowed , no instance and stat |
|
|
5. Can extend another interface only |
Multiple inheritance allowed |
|
6. Method is public |
|
- A Java class can implement multiple interfaces but it can extend only one abstract class.
Post a Comment