GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  J2EE  >  Java

 Print  |  
Question:  What is the difference between Abstract class and Interface

Answer:
Answered by Scott on 2005-05-12 10:03:06: An abstract class can contain non-abstract methods which do not have to be overridden in the subclass. 
 
There is no difference between a fully abstract class (all methods declared as abstract and all fields are public static final) and an interface.


January 01, 2006 08:02:54 #3
 Buddhadev Dasgupta   Member Since: Visitor    Total Comments: N/A 

RE: What is the difference between Abstract class and ...
 

another key difference between abstract class and interface is that , in abstract class we can put sharable code, but that is not possible in case of interface.

Another key difference between abstract class and interface is that,

We can use interface as marker, ( we can use abstract class also as abstract but then we can't extends any oter class, so it is better always use interface as marker)

     

 

Back To Question