Untitled Document

Subscribe here to get updates on new Videos

 

7. Interface vs abstract class vs concrete class?

 

 

 

previous homenext

 

Interface VS Abstract class VS Concrete class

1. If we don’t know anything about implementation just we have requirement specification (100% Abstraction) then we should go for interface.

Ex: Servlet.

2. If we are talking about implementation but not completely ( partial implementation) then we should go for Abstract class.

Ex: GenericServlet & HTTPServlet.

3. If we are talking about implementation completely and ready to provide service then we should go for concrete class.

Ex: MyOwnServlet.