Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

when to use abstract class and when to use interface?

Answer Posted / mohit jethva

In Interfate you are restricting a user to impement each
and every method of interface so if you have a requirement
which is constantly changing so don't prefere interface.

While in Abstract Class user don't need to implement each
and every method which is not required or marked with
mustoverride.


And by using interface you can achive multiple inheritance
in C# but with Abstact class it's can't be achive

Is This Answer Correct ?    31 Yes 21 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is broken and continue statement?

991


How will you initialize an Applet?

1141


Can an anonymous class be declared as implementing an interface and extending a class in java programming?

1262


Why we override equals() method?

1031


What is an example of a boolean?

1051


Explain features of interfaces in java?

982


What is singleton class example?

1019


Can we serialize singleton class?

1030


What is a get method?

1047


Can sleep() method causes another thread to sleep?

1036


Is string a wrapper class?

1010


What is the set interface in java programming?

1202


What is the difference between int and integer in java?

1023


Is math class static in java?

1109


Write a method to check if input string is palindrome?

1019