How does VB.NET/C# achieve polymorphism?

Answers were Sorted based on User's Feedback



How does VB.NET/C# achieve polymorphism? ..

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

How does VB.NET/C# achieve polymorphism? ..

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

How does VB.NET/C# achieve polymorphism? ..

Answer / raghumadhav tirunagari


Function overloading. Operator overloading.

Is This Answer Correct ?    5 Yes 3 No

How does VB.NET/C# achieve polymorphism? ..

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

How does VB.NET/C# achieve polymorphism? ..

Answer / radhakrishna

Static Polymerphism/Compiletime Polymerphism--> Function/Operator Overloading
Dynamic/Run time Polymirphism--> Function overriding

Is This Answer Correct ?    0 Yes 0 No

How does VB.NET/C# achieve polymorphism? ..

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

Post New Answer

More ASP.NET Interview Questions

Explain difference between friend and protected friend?

0 Answers  


I have to send data throug querystring from one page to another. But it should not be displayed in URL. How it is possible?

6 Answers   EMR, Wipro,


About CLS and CTS?

8 Answers   Microsoft, Syncfusion,


witch is the best insistute in sharpoint course.what abt future of share point course.

2 Answers  


How can we prevent an aspx page get refreshed when any information fetch from the database ?

2 Answers   Minecode,






What is the asp.net mvc folder conventions? : asp.net mvc

0 Answers  


Define page fragment caching?

0 Answers  


Given an ASP.NET Web Form called WebFrom1, what class does the WebForm1 class inherit from by default? a) System.Web.Form b) System.Web.GUI.Page c) System.Web.UI.Page d) System.Web.UI.Form

3 Answers   Syntax Softtech,


What is the basic purpose of the required field validator? How can you use a required field validator to check that the user changes the initial value of a text box? a listbox?

0 Answers  


What is application variable and when it is initialized ?

4 Answers   Keane India Ltd,


Mention few asp.net validators.

0 Answers  


what is difference between const, static and readonly?

2 Answers   TVS,


Categories