Link to home
Start Free TrialLog in
Avatar of curiouswebster
curiouswebsterFlag for United States of America

asked on

Please explain this lambda expression

 Thread t = new Thread ( () => Console.WriteLine ("Hello!") );
  t.Start();


What version of C# (or .NET Framework) is needed for this to compile?

Is this an lambda expression which uses an anonymous method?

How would you explain exactly what this is?  I am new to LINQ and multi-threading...

Thanks,
newbieweb
ASKER CERTIFIED SOLUTION
Avatar of nmarun
nmarun
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of curiouswebster

ASKER

> A Lambda expression is essentially an anonymous method

is that true for all Lambda expressions?


Also, in this code, the body {} is basically the body of the anonymous method?

new Thread (() =>
{
  Console.WriteLine ("I'm running on another thread!");
  Console.WriteLine ("This is so easy!");
}).Start();
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks.