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 an immutable object?

1094


What is byte data type?

990


What is scope & storage allocation of global and extern variables? Explain with an example

1034


What is type inference in java8?

1039


if u open login & logout ,how can udisplay the timelogin & logout members ?

2279


Can memory leak happen java?

998


Discuss about garbage collector in Java.

1073


What does t in java mean?

983


what is the purpose of the runtime class?

1058


Is multiple inheritance supported by java?

987


What is the difference between static method and instance method in Java?

1197


What is the difference between abstraction and encapsulation?

1041


Does java map allow duplicates?

887


What are decalarations?

1118


What happens when you invoke a thread’s interrupt method while it is sleeping or waiting?

974