Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between interface and abstract interface in java [closed]

Like the title says. What is the difference between an interface and an abstract interface in Java?

like image 220
Brad Avatar asked Aug 15 '26 09:08

Brad


2 Answers

There is no such thing as abstract interface in Java (as interface is abstract by default), there is Abstract class.

The main difference between an abstract class and an interface, is that abstract class is inherited (extended), as normal class, so you cannot extend two of them in parallel, while you can implement more than one interface at the same time.

like image 50
MByD Avatar answered Aug 16 '26 22:08

MByD


The abstract keyword is obsolete when working with Java interfaces, as a java interface by definition is abstract; it contains no implementation but only definitions.

like image 40
Frederik Wordenskjold Avatar answered Aug 16 '26 23:08

Frederik Wordenskjold



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!