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...

what is the difference between abstract class and
Interface?where we can use it in realtime projects?

Answer Posted / priyanjan

The core diffrence between abstract class and interface is
that interface does not allow implementation of method but
abstract class allows.

Interface is a bunch of declaration of relevant functions.
In real time projects, interface can used if we have to
implement any framework.for eg, if want to implement the
framework of stack,we can do it by defining the prototypes
of push(),pop(),peek() methods in an interface and then
implementing it by any class.
Abstract classes is useful when we are not
required to implement all methods in our class.for eg,we
have Vehicle class, we want to implement classes for two
wheelars in which hand brake is given and in some vehicles
foot brake are given, then Vehicle class abstract class can
be defined as abstract class and implemention of brake()
can be done in applicable classes.

Is This Answer Correct ?    84 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are different types of inner classes ?

1038


Are floats faster than doubles?

1051


What type of value does sizeof return?

991


How do you write a good declaration?

969


How many return statement are allowed in a function?

924


String and stringbuffer both represent string objects. Can we compare string and stringbuffer in java?

958


What is variable explain?

991


What is the difference between Grid and Gridbaglayout?

1230


What is difference between hashset and hashmap in java?

997


What is difference between static and abstract class?

994


Which arithmetic operations can result in the throwing of an arithmeticexception?

1010


What state is a thread in when it is executing?

953


How many bytes are there?

992


How is Object Oriented Programming different from Procedure Oriented Programming?

1041


What are 5 boolean operators?

1167