GeekInterview.com
Series: Subject: Topic:
Question: 12 of 573

Abstract class and interfaces

Where should we use exactly abstract class and interfaces?
Asked by: gvndrao | Member Since Apr-2012 | Asked on: Apr 30th, 2012

View all questions by gvndrao

Showing Answers 1 - 2 of 2 Answers
yuvaraj

Answered On : May 11th, 2012

All the methods declared inside an interface are abstract whereas abstract class must have at least one abstract method and others may be concrete or abstract.
b) In abstract class, key word abstract must be used for the methods whereas interface we need not use that keyword for the methods.
c) Abstract class must have subclasses whereas interface cant have subclasses.

  
Login to rate this answer.
rpmnitp

Answered On : Jul 13th, 2012

View all answers by rpmnitp

Interface is more generic in comparison to the Abstract class, hence when we want our implementing class to implement all the methods we should use Interface.

Yes  1 User has rated as useful.
  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.