What is the differances between a abstract calss and
interface
Answer Posted / 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 |
Post New Answer View All Answers
What is the base class from which web forms are inherited?
Who can consume WebAPI?
How does asp.net page work?
Is asp.net and .net the same?
What are query strings used for?
Name the method that needs to be invoked on the dataadapter control to fill the generated dataset with data?
Do you support digital rights management to protect my videos?
What is the recommended approach for asp.net mvc to globally intercept exceptions? What other functionality can be implemented with the approach? : Asp.Net MVC
Define asp.net caching?
How does u get record no from 5 to 15 from a dataset of 100 records?
Explain the different types of directives in .net?
Explain the difference between Web Garden and Web Farm?
Define the term Scavenging in Caching?
What are the advantages of using session?
Explain the difference between server.transfer and response.redirect? Why would I choose one over the other?