What is the differances between a abstract calss and
interface

Answers were Sorted based on User's Feedback



What is the differances between a abstract calss and interface..

Answer / alb.shah

ABTRACT CLASS:
-------------
• It can not be instantiated
• It allow us to specify all access modifier except
Private
• A class inheriting this must implement all of its
abstract method
• A class can inherit only one abstract class at a
time.
• Abstract class can add more functionality with out
destroying child classes that were using old version.
• We can declare the following
1. Fields
2. Constructors
3. Static Constructors
4. Static Functions
5. Concrete Functions

INTERFACE :
---------
• It can not be instantiated
• It allows only public Access modifier
• A class implementing interface must provide body
for its entire member.
• A class can implement more than one interface at a
time.
• Adding of additional functionality will have an
effect on its child class due to the necessary
implementation of interface methods.
• We can not declare the following
1. Fields
2. Constructors
3. Static Constructors
4. Static Functions
5. Concrete Functions

Is This Answer Correct ?    5 Yes 0 No

What is the differances between a abstract calss and interface..

Answer / gyan

abstract class may contain concreate methods with abstract
methods where as interface containls only abstract methods

by default all methods in interface are public
where as abstract class can contain all modifiers except
private


abstract class involves in inheriting chain . where as
interfaces there is no need to follow inherit chain

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More ASP.NET Interview Questions

How do you insert multiple rows from a grid view to database table under a single transaction?

1 Answers  


Describe the Server Control Events of ASP.NET?

0 Answers   SwanSoft Technologies,


What is the significance of ASP.NET routing?

0 Answers   NA,


Using code explain Configuration Management

0 Answers  


How will create assesblies at run time?

0 Answers  






Explain asp.net web forms.

0 Answers  


What is state management technique?

0 Answers  


What are the types of caching in asp.net?

0 Answers  


Where would you use an ihttpmodule, and what are the limitations of any?

0 Answers  


Why do we need master page in asp.net?

0 Answers  


what is satellite assembly in .net?

4 Answers   iSoft,


What do you mean by marshalbyref?

0 Answers  


Categories