How does VB.NET/C# achieve polymorphism?
Answers were Sorted based on User's Feedback
Answer / srinivas
1. function overloading,
2. Runtime polymorphism --Using Interface reference,
EX:
interface name I ,abstract Method();
implimenting classes A,B
ref I;
objA= new A();
objB= new B();
runtime
objA=I
objA.Method();
objB=I;
objB.Method();
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / anand gopal makwa munger
1.Function overloading.
2.Operator overloading.
You can achieve by checking the Dependency Like Below.
1.Function overloading Doesn't depends on Return type it must be same.
2.Name must be same.
3.It depends on Number of parameter. Parameter must be different.
4.it depends on different datatype of parameter.
5.It depends on order of parameter.
6.it does't depends on parameter name.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / raghumadhav tirunagari
Function overloading. Operator overloading.
| Is This Answer Correct ? | 5 Yes | 3 No |
Answer / roopesh m.k
polimorphism is the one of the oops features, allows one
object to appear in different form by changing the type.
Two types:
1- Static eg:method overloading
2- Dynamic eg:method overriding
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / radhakrishna
Static Polymerphism/Compiletime Polymerphism--> Function/Operator Overloading
Dynamic/Run time Polymirphism--> Function overriding
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / deep
Polymorphism is also achieved through interfaces. Like abstract classes, interfaces also describe the methods that a class needs to implement. The difference between abstract classes and interfaces is that abstract classes always act as a base class of the related classes in the class hierarchy. For example, consider a hierarchy-car and truck classes derived from four-wheeler class; the classes two-wheeler and four-wheeler derived from an abstract class vehicle. So, the class 'vehicle' is the base class in the class hierarchy. On the other hand dissimilar classes can implement one interface. For example, there is an interface that compares two objects. This interface can be implemented by the classes like box, person and string, which are unrelated to each other.
C# allows multiple interface inheritance. It means that a class can implement more than one interface. The methods declared in an interface are implicitly abstract. If a class implements an interface, it becomes mandatory for the class to override all the methods declared in the interface, otherwise the derived class would become abstract.
| Is This Answer Correct ? | 0 Yes | 0 No |
Where is asp.net session stored?
How we can bind textbox,listbox and datagrid to sql server database in asp.net using visualstudio.net language (vb.net)?
What is difference between datalist and gridview?
differences between class inheritance and interface?
What would be salary for 8+ years of experience in ASP.NET in different metro city in india?
What is viewstate information stored?
How to configure a website without using IIS.
What is localization and Globalization?
Is post back property in asp net?
What is jade template engine?
Can the validation be done in the server side? Or this can be done only in the Client side?
How can you change a Master page dynamically in which event of page life cycle?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)