Wednesday, April 28, 2010

return a = “hello”; What will Happen?

I came across an interesting piece of code the other day, something I didn’t even know possible in C#.

Consider the next code (which doesn’t make lots of sense, but it gets the point across):

public string Test()
{
 string a;
 return a = "hello";
}

What do you think will happen? what will be returned from this method?

Read more: IronShay

Posted via email from jasper22's posterous