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

Can two catch blocks be executed?

13 Answers  

what are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET?

1 Answers  

When a new instance of a type is created, what is the type of method implicitly called?

2 Answers  

Can we create instance for Abstract class?

28 Answers   Wipro, SoftSol, Satyam, HCL,

What are the collection classes ?

2 Answers   Digital GlobalSoft,

what are the events in delegate?

2 Answers   Choice Solutions,

Are private class-level variables inherited?

5 Answers   HCL, Visual Soft,

What does assemblyinfo.cs consists ?

4 Answers   Microsoft,

What?s the difference between the System.Array.CopyTo() and System.Array.Clone()?

3 Answers  

An abstract class is inherited, an Interface also inherited(multiple inheritance), How it differences.

6 Answers   Synechron,

Does the variables of a private class-level inherited?

0 Answers   Siebel,

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

3 Answers   Visual Soft,