Difference between abstract class and interface

Answer Posted / venkataramana

A method with method body is called "Concrete method or
Complete method".
A method without method body is called as "Abstract Method".

Abstract Class :
----------------
1.An abstract class is a class which contains 0 or more
abstract methods.
2.An abstract class can have ,
* Instance Variables
* Complete Methods
* Abstract Methods
3.When an abstract class is written, it is the duty of the
programmer to provide sub classes to it.
4.We cannot create an object to abstract class.
5.But we can create a reference to the abstract class.
6.we cannot declare a class as both abstract and final.

Interfaces:
-----------
1.An interface is a specification of method prototypes.
2.An interface contains only "Abstract Methods".
3.An interface contains Constants
4.All the methods of an interface can be "abstract and
final" by default.
5.We cannot create an object to abstract class.
6.But we can create a reference to the abstract class.
7.An interface is written , when the programmer wants to
leave the implementation to the thid party vendors.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to improve the cache performance? : .NET Architecture

558


What is a managed code is dim fs as filestreamobject is a managed code? : .NET Architecture

670


Explain dma? : .NET Architecture

546


What is the procedure on hardware that converts the ascii value to binary? : .NET Architecture

540


Explain the use of virtual, sealed, override, and abstract.

577






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

506


How do we do authentications using atlas?

537


Explain pipelining? : Dot net architecture

598


Can you Explain element .net mobile with example? : Microsoft dot net mobile

491


How resource files are used in .net?

554


How do I prevent concurrent access to my data?

555


Explain How to improve the cache performance? : Dot net architecture

524


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

575


What is .net transaction?

486


What is .net mobile images control. Explain with an example? : Microsoft dot net mobile

509