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  >  Core Java
Go To First  |  Previous Question  |  Next Question 
 Core Java  |  Question 485 of 492    Print  
Usage of Abstract class and Interfaces
In Real time when we go for Abstract classes and when we go for Interfaces


  
Total Answers and Comments: 3 Last Update: August 13, 2008     Asked by: sekhark.k 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
July 16, 2008 09:43:04   #1  
GMadhavaReddy222 Member Since: July 2008   Contribution: 3    

RE: Usage of Abstract class and Interfaces
In realtime If we want to provide some of the features to lower developers then we will for abstract class and If we want to provide complete features to lower developers then we will go for Interface
 
Is this answer useful? Yes | No
July 20, 2008 08:13:20   #2  
geeky1 Member Since: July 2008   Contribution: 2    

RE: Usage of Abstract class and Interfaces
Depends on the design consideration. If one wants the design  to be flexible then go for the interface else abstract class.
The abstract class can contain default implementation which is inherited by the subclasses by default. If you are looking for performance then abstract class is the best choice

 
Is this answer useful? Yes | No
August 13, 2008 07:03:54   #3  
sangamesh32 Member Since: August 2008   Contribution: 3    

RE: Usage of Abstract class and Interfaces
Abstract class means partial implementation which means he cannot directly use properties of this class i.e he has to inherit it and use the class and also allowed to provide extra properties. One real time use of abstract class is it can be used as a Adapter class.

Interfaces are open for implementation, to use interfaces he has to provide implementaion to all methods. i.e interfaces are just specification which states what to do not how they are done.

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape