when should i use abstract classes and when


When should I use abstract classes and when should I use interfaces?

 Use Interface, when:

  • Design changing often or when various implementations only share method signatures.
  • When we need some classes to use some methods which we don't want to be included in class.

Use Abstract Class, when:

  • Several implementations are of the same kind and use common behavior.
  • Enabling with generalized form of abstraction and leave implementation task with inheriting subclass.
  • creating planned inheritance hierarchies

 

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: when should i use abstract classes and when
Reference No:- TGS0355113

Expected delivery within 24 Hours