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

What is predicate c#?

0 Answers  


What is primitive types in c#?

0 Answers  


What is the task perform by clr?

0 Answers  


what is the purpose of new keyword while creating an object?

3 Answers  


What is default boolean value in c#?

0 Answers  






What is the difference between a variable and a literal?

0 Answers  


What is polymorphism? pl explain practically rather than theoretical?

3 Answers  


What is dictionary and hashtable in c#?

0 Answers  


Can we set image Source dynamically using C# in WPF application?

0 Answers   Tech Mahindra,


What is gac? What are the steps to create an assembly and add it to the gac?

0 Answers  


What is the difference between early binding and late binding in c#?

0 Answers  


Can we have the method in drived class with the same name which is there in base class?

6 Answers   TCS,


Categories