Difference between Interface with default method and abstract class

preview_player
Показать описание
1)In interface all the variables are public ,static and final by default and we can not declare instance variable whereas in case of abstract class we can declare instance variable.

2)We can’t declare/write constructor inside interface whereas we can write constructor inside abstract class.

3) In case of interface we cant declare static and instance blocks whereas we can declare these blocks in abstract class.

4) Inside interface we can’t override Object class methods whereas we can override object class methods in abstract class.
Рекомендации по теме
Комментарии
Автор

very nicely explained...very important topic for interviews👍👍

suddharghyasom
Автор

Very nice explanation along with live examples. Thanks for this

harshparikh
welcome to shbcf.ru