what is Anonymous Method.? and

What is shadowing?




Answers were Sorted based on User's Feedback



what is Anonymous Method.? and What is shadowing?..

Answer / guest

methods with no names are called as annonymous methods

when two or more programing elements eg.a method has same
name that of other then one method is hiden and has no
reference this is known as shadowing

Is This Answer Correct ?    5 Yes 1 No

what is Anonymous Method.? and What is shadowing?..

Answer / kavitha

Anonymous method - those method which does have any name and
type.. while declaration but its type is defined dynamically
depending upon the type the method

for eg-
int n = 0;
Del d = delegate() { System.Console.WriteLine("Copy #:{0}",
++n); };


shadowing - if two methods have the same name and
signature. we can hide the scope of one method to access
another method
using shadow keyword .

for eg - we can use tostring() method in our program by

Public Class Class2
Inherits Class1
Shadows Sub MethodA()
MsgBox(“Method A Class2 called”)
End Sub
Overrides Sub MethodB()
MsgBox(“Method B Class2 called”)
End Sub
End Class

Is This Answer Correct ?    6 Yes 2 No

Post New Answer




More C Sharp Interview Questions

how to cleanup object that does not support dispose method? How to implement dispose for such scenarios?

2 Answers   ITC Infotech,


How do I create a multilanguage, single-file assembly?

0 Answers  


what is output parameter and parameter array?

1 Answers   TCS,


What is the CTS, and how does it relate to the CLS?

0 Answers   Arigo Infotech,


What is the difference between string keyword and system.string class?

0 Answers  






Explain the three services model (three-tier application). Presentation (ui), business (logic and underlying code) and data (from storage or other sources).

0 Answers  


What?s the implicit name of the parameter that gets passed into the class? set method?

1 Answers  


can we assign null value to value type in c#?

12 Answers   Wipro, Idea, Microsoft,


Define a class and an object?

0 Answers  


Explain about WSDL

0 Answers   Digital GlobalSoft,


How?s method overriding different from overloading?

2 Answers   Visual Soft,


What's the difference between System.String and System..StringBuilder in C#?

0 Answers   PUCIT,






Categories