While reading an MCSD study guide, I noticed the author said it was illegal to include a return
statement in a method that declares the return type void
. However, when I created the following method Visual Studio didn't flag it in the editor nor did it fail to compile:
private void ReturnNothing()
{
return;
}
What is the real answer then? Is this legal?