what is Anonymous Method.? and

What is shadowing?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of dll file in c#?

455


What is difference between ienumerable and enumerable in c#?

467


Define the term immutable ?

605


What does get set mean in c#?

483


What are the generation of Garbage Collection in C# .NET ?

546






Define delegate?

533


Why do we use void in c#?

462


Are there functions in c#?

497


Is datetime a value type in c#?

479


What is the difference between string and stringbuilder in c#?

463


Is java better than c sharp?

498


Write the difference between TypeOf and GetType?

579


What is list array in c#?

463


Does c# support multiple class inheritance?

599


How does foreach loop work in c#?

469