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

What is final, finally, finalize?

1187


What are the different access modifiers available in java?

1074


What's the access scope of protected access specifier?

1096


What are recursive functions?

1102


Is special character in java?

1136


What is contract between hashcode and equal method?

1096


What are format specifiers in java?

1107


Is string a wrapper class?

1060


Is this valid in java ? Can we instantiate interface in java?

1024


When can an object reference be cast to an interface reference in java programming?

1066


What is the purpose of an interface?

1095


List some important characteristics on jre

1132


What is the difference between the prefix and postfix forms of the ++ operator?

1056


Is zero a positive integer?

1143


Which one of the following suits the description of a string better: derived or primitive?

1010