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 / amit

Abstract provides both methods with and without body.
Adding new methods in abstract class in middle of
development life cycle won't break existing sub classes
unless these methods are declared as mustoverride. If there
are frequent addition of new methods properties and so on.
one should use abstract..

Whereas on the other hand interface can fill gap of
multiple inheritance. One can
implement from more than one interface. Not same with
Abstract. One can inherit
from only one abstract class.

Is This Answer Correct ?    44 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between map and flatmap stream operation?

1213


What is the purpose of java?

951


Discuss about garbage collector in Java.

1039


What is java lang object?

935


What are the differences between string, stringbuffer and stringbuilder?

979


Why do we declare a class static?

1081


What is field name?

964


Why are parameters used in functions?

956


Can we increase size of array?

987


What is the synchronized method modifier?

1146


Tell me the latest versions in java related areas?

1053


What if the main() method is declared as private? What happens when the static modifier is removed from the signature of the main() method?

1159


How can you make a class serializable in java?

951


What is stringbuffer in java?

1010


What is arrays fill in java?

961