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 a hashset c#?

476


Are c and c# the same thing?

490


What is a multicast delegate in c#?

533


Can we make a Static Constructor Parameterized? Give Reason with your answer

549


What is mvc firstordefault?

482






What are satellite assemblies?

558


What's the difference between a method and a procedure?

480


Is arraylist generic in c#?

470


Classes and structs can be declared as static, is this statement true or false?

551


Can we write class inside a class in c#?

545


How do I create a delegate/multicastdelegate?

547


What are desktop applications examples?

491


What is binding in c#?

491


What you mean by delegate in c#?

498


What is a class c#?

475