ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories >> Software >> Java-Related >> Java-J2EE >> Core-Java
 
 
 
Question
can u give one sinario when you use Abstract Class and When
you use Interface.
 Question Submitted By :: Subhranta
I also faced this Question!!     Rank Answer Posted By  
 
Answer
If we have more than two classes with same method names but 
their implementation is different.we can go for interface.
Example: JDBC API Interfaces. Every data base vender 
implements these interfaces with thier implementation code.

If we want to use some common method implementaions for 
multiple classes along with their own implementation we can 
go for abstract class.

Example:Servlet API:
HttpServlet is an abstract class in which init() is 
implemented used by every servlet that extends.Every 
servlet implement their own service method.
 
0
Srinivasa
 
View All Answers
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com