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

Define an interrupt? : Dot net architecture

555


Explain cache memory? : Dot net architecture

540


How to upload in video,mp4,in .net 4.5 ..?

554


Whats new features in Visual Studio 2012?

552


Explain cache? : .NET Architecture

565






How is the using() pattern useful? What is idisposable?

516


.Net Frame work arch?

1620


i wish to write mcts(microsoft certified technology specialist) exam. can anyone give the model question or format and preparation method?

2314


What is new in the .net 2.0 class library?

700


What is cookie less session?

577


Can you explain atlasuiglitz library?

534


Are there any third party logging components available?

535


can u give me real example of how web.config overrides the machine.config file?

1299


Explain some of the disadvantages due to microsoft.net?

543


I want to create a project like google maps how can we do that with atlas?

486