OOPs INTERVIEW QUESTION & ANSWERS
DOT Net
TAGS
36. | What is another name for overloading? |
---|---|
Ad-hoc polymorphism is another name for overloading. |
Posted by Kamaraju. (Jul 25, 2014) | |
Compile Time Polymorphism or Early Binding. |
37. | How is method overriding different from method overloading? |
---|---|
When overriding a method, you change the behavior of the method for the derived class. Overloading a method simply involves having another method with the same name within the class. |
38. | What are the four types of polymorphism? |
---|---|
|
39. | What does a break statement do in switch statements? |
---|---|
The break statement terminates the loop in which it exists. It also changes the flow of the execution of a program. In switch statements, the break statement is used at the end of a case statement. The break statement is mandatory in C# and it avoids the fall through of one case statement to another. |
40. | Why is the virtual keyword used in code? |
---|---|
The Virtual keyword is used in code to define methods and the properties that can be overridden in derived classes. |