CoolInterview.com - World's Largest Collection of Interview Questions
Send Free SMS
 Interview Questions  
 Our Services  


INTERVIEW QUESTIONS MICROSOFT ASP.NET 2.0 DETAILS
Question :
What is difference between abstract class and an interface?
What is shadowing?
Difference between Overriding and overloading.


Category ASP.NET 2.0 Interview Questions
Rating (0.0) By 0 users
Added on 7/28/2006
Views 1012
Rate it!
Answers:

An abstract class and Interface both have method only but not have body of method.The difference between Abstract class and An Interface is that if u call Ablstract class then u have to call all method of that particular Abstract class but if u call an Interface then it is not necessary that u call all method of that particular interface.Method OverLoading:-Return type, Parameter type, parameter and body of method number may be different.Method Overriding:- Return type, Parameter type, Parameter Number all must be same . Only body of method can change.



I don't agree with the above answer.
Abstract classes and Interfaces both are used either for design reasons or Security reasons.Both are used when you want to force a protocol of behaviour or anything you wants to come into the system.Take an Example of shape,line,circle and rectangle.
Anyone who wants to become a shape can implement the IShape interface and come into the system, this can also be achieved using abstract class but in case of abstract class if some one derives a class from line class that also comes into the system forcefully.So there is a choice whether you want to force something or you wants to make it optional.If you want to force then use abstract class if you want to keep optional use Interfaces.

Abstract class and Interfaces both are basically the same but with one major difference.Abstract classes are used whenever you want to force a Inheritance hierarchy whereas in Interfaces this is optional.If anybody wants to come into the system then he has the choice of implementing the interface and thus comes into the system.Whereas if you use abstract class then the all the classes down the hierarchy comes into the system forcefully.



 Posted by: Narayan Sahu    

Contact Narayan Sahu  Contact Narayan Sahu

Well i can comment about an abstract class
i think abstract class is a class which serves as a templete class for all the derived classes.we usually did not make an instance of an abstract class



 Posted by: imran    

Contact imran  Contact imran

Shadowing is the concept where programming elements having the same name hides the identity of one.
e.g : In case of inheritance the derived class member hides the base class member with the same name.



 Posted by: Prerna    

Contact Prerna  Contact Prerna


If you have the better answer, then send it to us. We will display your answer after the approval.
Name :*
Email Id :*
Answer :*
Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
Process Verification  Enter the above shown code:*
Inform me about updated answers to this question

   
Related Questions
View Answer
How to create a DB connection at one place/page so that we can use that connection for all pages/forms/windows.what r the steps ned to be performed.
if question not clear,let me know.
View Answer
What is IPostBack? How to use it?
View Answer
What is server infrastructure & Server components?
View Answer
What is event bubbling?
View Answer
Which dll handles the request of .aspx page?
View Answer
How to reduce the width of textbox in EditCommandColumn of DataGrid?
View Answer
If we remove web.config or machine.config from the application
then, Is this application will works?
View Answer
List of Words of PreProcessor in .NET?
View Answer
Please brief not about XSD,XSLT & XML.
View Answer
What is PreProcessor in .NET and type , where it use
View Answer

Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

Notify me when better answer is posted!
Email:

View ALL ASP.NET 2.0 Interview Questions

User Options
Sponsored Links


Copyright ©2003-2010 CoolInterview.com, All Rights Reserved.
Privacy Policy | Terms and Conditions
Page URL: http://www.coolinterview.com/interview/8788/default.asp?cachecommand=bypass


Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Free SMS | Dedicated Servers | Joke of the Day

0.78