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 loop means?

910


What is the difference between math floor and math round?

993


Can we use string in the switch case?

1000


What do you understand by an io stream?

1002


Explain the selection sort algorithm?

1013


What is the difference between C++ and Java and your preferences?

1079


How to instantiate member inner class?

1039


What is use of a abstract variable?

942


What is Java Reflection API? Why it’s so important to have?

1097


List types of storage classes in java?

1088


What are the Static and Dynamic Variables? Differentiate them.

1062


Describe what a thread-local variable is in java?

974


Why do we use regex?

965


Can a static class implement an interface?

1072


What is public static?

992