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 difference between abstract and interface?
can i give real time example for the two topics?

Answer Posted / lakshmi

Interface has no implementation, but they have to be
implemented.
Abstract class’s methods can have implementations and they
have to be extended.
Interfaces can only have method declaration (implicitly
public and abstract) and fields (implicitly public static)
Abstract class’s methods can’t have implementation only
when declared abstract.
Interface can inherit more than one interfaces
Abstract class can implement more than one interfaces, but
can inherit only one class
Abstract class must override all abstract method and may
override virtual methods
Interface can be used when the implementation is changing
Abstract class can be used to provide some default behavior
for a base class.
Interface makes implementation interchangeable
Interface increase security by hiding the implementation
Abstract class can be used when implementing framework
Abstract classes are an excellent way to create planned
inheritance hierarchies and also to use as non-leaf classes
in class hierarchies.

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you understand by overloading and overriding in java?

1012


how do I create a runnable with inheritance? : Java thread

937


Can we have this () and super () together?

980


what do you mean by classloader in java?

974


What is string literal in java?

996


Why do we create public static method in java?

1044


Describe different states of a thread.

940


Explain the importance of finalize() method.

916


What is sortedset in java?

976


What do you mean by pointer value and address?

999


Explain restrictions for using anonymous inner classes?

1036


What do you mean Abstraction in java?

1038


Give an example of use of pointers in java class.

964


What is the size of an array?

963


What are serialization and deserialization?

1193