PRE-KNOWLEDGDE:
So both are a sketch of the real class you are going to write. This are the 6 differences:
Abstract Class |
Interface Class |
Explanation |
|
1 |
You call the class: abstract class + className |
You call the class: interface + className |
|
2 |
You use the keyword: extends |
You use the keyword: implements |
|
3 |
You can add methods that are already complete and you can add methods that are just a sketch |
You only add sketches of methods |
|
4 |
You use variables |
You only use constants |
|
5 |
You extend one Abstract Class |
You can implement multiple Interfaces |
|
6 |
You can have a constructor |
You CANNOT have a constructor, you can only have constants therefore there is no need for a constructor |