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

What are bindings?

558


What is cookie less session?

576


how to create applications by using Visual Studio 2012?

578


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

1350


Explain the purpose of cache? : Dot net architecture

479






How do you handle this COM components developed in other programming languages in .NET?

582


What re interop services?

564


What is .net mobile utility controls. : Microsoft dot net mobile

497


What is Com Callable wrapper?when it will created?

534


How do I stop a thread?

543


Explain the difference between primary & secondary storage device? : Dot net architecture

514


Define a managed code? : Dot net architecture

512


Describe the Managed Execution Process in .NET?

541


What is textbox control of .net mobile? : Microsoft dot net mobile

619


What do you know about machine.config file ?

570