تفاوت interface و Abstract class در جاوا به شرح زیر می باشد:
Abstract Class | Interface |
contains zero or more abstract methods | interface contains all abstract methods |
Abstract class can contain variable | interface contains only constant |
Abstract class contains constructor | interface does not have any constructor |
extend keyword is used for abstract class for provide body of abstract methods | Implement keyword is used to provide methods of interface |
java supports 3 types of structures as follows: