Difference between abstract class and interface

Answer Posted / anwar .s

Abstract class:
.class inherites one class at time
(eg)class A extends B
.if we need two class two properties.Abstract class is not
possible.becoz it doesn't support multiple inheritance
(eg)class A extendssB,c->not possible.
.we cannot create object for abstract class.it doesn't
occupy memory
.it gives structure to program
.we cannot inherits properties to Abstract class.but we can
inherits all the properties from abstarct class.
.Abstract class have atleast one Abstract method
Interface:
.interface is nothing but u give structure for project will
be created on our desire
(eg) u give plan of house to buit.u told that i want this
model house.similiar to that programmer developed the
project according to ur plan they develop the code.they cant
change ur plan bcoz all are abstract
.by using interface multiple inhertance is possible
.(eg)interface implements classA,B,c...n
.interface is bodyless.
.the variable decalared inside the interface act as final
variable.we cannot re assign
(eg)final int a=10
int a=15 it shows error while compiling.

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to change row background color in gridview

552


What is the importance of updatepanel control?

537


Differences between VS 2005, 2008 and 2010 ?

574


What is an interrupt? : .NET Architecture

467


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

1344






What is parallel computing?

536


Explain .net mobile events? : Microsoft dot net mobile

513


Why the config file might not be writable

563


State and explain about microsoft.net?

522


Waht is Dot net Arcitecture

1952


What is a virtual memory? : Dot net architecture

529


what are the events for a form?

1601


How can implement drag and drop using atlas?

566


Explain dma? : Dot net architecture

550


what is polymorphism and advantage ?

1511