Thursday, March 30, 2017

Interface vs abstract class vs concrete class in java

Interface vs abstract class vs concrete class:-
Interface:-
If we don’t know anything about implementation just we have requirement specification then we should go for interface.
Ex:-  Servlet, Collection
Abstract class:-
If we are taking about implementation but not completely (partial implementation) then we should go for abstract class.
Ex:-
 GenericServlet (AC), HTTPServlet (AC)
Concrete class:-
If we are taking about implementation completely and ready to provide service then we should go for concrete class.
Ex:-




No comments:

Post a Comment