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

Difference between abstract class and interface

Answer Posted / rama krishna

Abstract class:

*A class of only Concrete or only Abstract or both.

*Any java class can extend only one abstract class.

*It won’t force the programmer to implement/override all its methods.

*It takes less execution time than interface.

* It allows constructor.

This class can’t be instantiated directly.

A class must be abstract when it consist at least one abstract method.

It gives less scope than an Interface.

It allows both variable & constants declaration.


It allows methods definitions or declarations whenever we want.

It gives reusability hence it can’t be declared as “final”.

Interface:

only abstract methods.


A class can implements any no. of interfaces
(this gives multiple interface inheritance )

It forces the programmer to implement all its methods

Interface takes more execution time due to its complex hierarchy.
* It won’t allow any constructor.

It can’t be instantiated but it can refer to its subclass objects.



It gives more scope than an abstract class.

By default, methods&#61664;public abstract
variables&#61664;public static final.


It allows methods declarations whenever we want . But it involves complexity.

Since they give reusability hence they must not be declared as “final”.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is private constructor? And it's use?

1039


How can implement drag and drop using atlas?

961


What is MS chart control in visual studio?

1164


What are the important principles of soa (service oriented architecture)?

871


What is the difference between an application and a program?

884


Explain cache memory? : Dot net architecture

905


Explain the race around condition? : .NET Architecture How can it be overcome? : .NET Architecture

872


Explain the difference between inprocess vs out process session state : Dot net architecture

1014


What is .net mobile utility controls. Explain with an example? : Microsoft dot net mobile

833


Xmlserializer is throwing a generic "there was an error reflecting myclass" error. How do I find out what the problem is?

913


Session State and can i store desirialized object in state server, if yes how and if not why.

1720


Which software is used for .net programming?

896


What is the purpose of cache? How is it used? : Dot net architecture

851


Can you explain atlasuiglitz library?

890


Differnce between managed code and unmanaged code ?

1001