asp.net

Posted by Shubhashree under ASP.NET on 3/3/2009 | Views : 1415 | Status : [Member] | Replies : 3
1.can we edit data in viewstate
2.what is advantage of interface over abstract
3.in a table i have enterd no from 1 to 100 but at last when i check i see only 99 entered how to find the no left while entering logically




Responses

Posted by: Majith on: 3/3/2009 [Member] Starter

Up
0
Down
Hi ShubaShree,

Interfaces are similar to classes. Interfaces differ from classes in that they don't include any member implementation.

An interface does not have any method implementation. It can include a method declaration .A class can implement several interfaces and the class can extend only one abstract class.

In Interface it requires extra indirection to find the corresponding method in the actual class (Slow process) and abstract classes are act fast.






Shubhashree, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Neeks on: 3/4/2009 [Member] Bronze

Up
0
Down
I this these links will help you to find the difference between Interface and Abstract class

http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/5572664a-33d6-4a03-8561-64bdca8777ed/


http://www.dotnetspider.com/resources/1169-Abstract-Class-Vs-Interface-Difference.aspx

Shubhashree, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Susantaown on: 3/5/2009 [Member] Starter

Up
0
Down
Hi Shubhashree

2:what is advantage of interface over abstract

What's the difference between an interface and abstract class?
1. Interface comes in Inheritance chain while Abstract not
2. One class can inherit muliple interface but it can't
inerit mulitple abstract class
3. Abstract class can have concert method but interface
can't.
4.An abstract class can contain fields, constructors, or
destructors and implement properties. An interface can not
contain fields, constructors, or destructors and it has
only the property's signature but no implementation.
5.Abstract classes are faster than interfaces.


Hope it will help ..

susant
Mumbai

In which scenario we will use interface and an abstract class.
Here are some recommendations to help you to decide whether to use an interface or an abstract class to provide polymorphism for your components.
<>If you anticipate creating multiple versions of your component, create an abstract class. Abstract classes provide a simple and easy way to version your components. By updating the base class, all inheriting classes are automatically updated with the change. Interfaces, on the other hand, cannot be changed once created. If a new version of an interface is required, you must create a whole new interface.
<> If the functionality you are creating will be useful across a wide range of disparate objects, use an interface. Abstract classes should be used primarily for objects that are closely related, whereas interfaces are best suited for providing common functionality to unrelated classes.
<> If you are designing small, concise bits of functionality, use interfaces. If you are designing large functional units, use an abstract class.
<> If you want to provide common, implemented functionality among all implementations of your component, use an abstract class. Abstract classes allow you to partially implement your class, whereas interfaces contain no implementation for any members



Shubhashree, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response