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 / anshul verma

* Major diffrence :- Interfaces are fully implementation of
abstraction

Abstract classes are Partially implementation of abstraction

that's a very important diffrence....

and

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 ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can constructor be synchronized?

986


Why multiple inheritance is not supported by java?

1025


Will the jvm load the package twice at runtime?

1147


Why runnable interface is used in java?

1192


What is meant by nested loop?

1089


What is module in oop?

1076


What is a parameter in a function?

1036


What is meant by flickering?

1130


What are heterogeneous objects?

1085


What is difference between path and classpath variables?

1150


What is the difference between yield() and sleep()?

1063


Explain an algorithm to find depth of a binary tree.

1098


Explain the use of sublass in a java program?

1078


What is module in project?

1025


Why do we need hashset in java?

1094