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 the method overriding?

1082


Define how does a try statement determine which catch clause should be used to handle an exception?

1168


What is palindrome in java?

996


How many types of equations are there?

1020


Explain the importance of finally block in java?

967


Explain the scope of a variable.

1099


Which collection is best for sorting in java?

1128


Is there any difference between nested classes and inner classes?

1099


What is :: operator in java 8?

1026


What is final int?

1026


What is Java Shutdown Hook?

1204


What is the difference in between cpp and java? Can u explain in detail?

1091


What is sorting in java?

992


What is the default size of arraylist in java?

1128


What is java util list?

962