When i have delegate like
public delegate void PrintMe();
(1)
PrintMe a = delegate() { MessageBox.Show("Hello"); };
a();
(2)
PrintMe b = () => { MessageBox.Show("Hello"); };
b();
(3)
PrintMe c = new PrintMe(HelpMe);
c();
static void HelpMe()
{
MessageBox.Show("Help Me");
}
for (1) and (2) I did not instatntiate the delegate it is directly pointing to anonymous methods.But as in the case of (3) I need to instatntiate the delegate and pass the static method.for case (3) can't i declare like PrintMe c= HelpMe(); ?
.How does (1) and (2) work?