Difference between abstract class and interface

Answer Posted / sunita

1) abstract classes may contain one or more abstract methods(methods that can't be instantiated). on the other hand interface should contain only abstract methods.

2) abstract classes may implement some of its methods that are not abstract. but interface can't implement any of its method becoz al its methods are abstract.

3)in interfaces all the methods are implicitly abstract,final,static so these modifiers can b omitted but this nit the case wid abstract classes.

4)an important point to note about abstract classes is: they can be subclassed,this sub class implement all the abstract methods that are declared in abstract class.

interfaces provide an alternative to multiple inheritance becoz a class can implement more than one interface.

but an abstract can b sub classed only once.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe the advantages of writing a managed code application instead of unmanaged one. What is involved in certain piece of code being managed?

606


What size is a .net object?

632


define cache memory? : Dot net architecture

531


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

2306


Can you explain update progress control?

521






Explain the Lapsed Listener problem in .net

665


What are bindings?

552


where should I put this information then?

581


Explain dma? : .NET Architecture

534


What is the difference between metadata and menifest ?

469


Explain hard disk and what is its purpose? : Dot net architecture

511


What is the .net class that allows the retrieval of a data element using a unique key?

565


How do I stop a thread?

540


Explain Singleton design pattern in .net

574


Explain dotnet framework ?

523