title: Anonymous function converted to a void returning delegate cannot return a value
body: <p>I have a general question: in the C# code below thread <code>tFour</code> can not be created and the compiler shows me the following error: "<em>Anonymous function converted to a void returning delegate cannot return a value</em>"</p>
  
  <p><strong>THE CODE</strong></p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading;
  using System.Threading.Tasks;
  
  namespace DelegatesAndLambda
  {
      class Program
      {
          public static int ThrowNum(object a)
          {
              Console.WriteLine(a);
              return 2 * (int)a;
          }
          static void Main(string[] args)
          {
              Func&lt;int&gt; newF = delegate () { int x = ThrowNum(2); return x; };
              Thread tOne = new Thread( delegate () { int x = ThrowNum(2); });
              Thread tTwo= new Thread(()=&gt; ThrowNum(2));
              Thread tThree = new Thread(() =&gt; newF());
              Thread tFour = new Thread(delegate () { int x = ThrowNum(2); return x;});
          }
      }
  }
  </code></pre>
  
  <p>However, threads <code>tOne</code>, <code>tTwo</code> and <code>tThree</code> are created without an error. So why does the lambda expression allows to pass a method delegate with return (non-void) value and multiple parameters (<code>ThrowNum(2), newF()</code>) while an anonymous method with return value ( <code>delegate () { int x = ThrowNum(2); return x;}</code>)  defined using the delegate keyword can not be passed? I thought in both cases we deal with anonymous methods?  I do know that <code>Thread</code>  accepts only two types of signatures : <code>void DoSomething()</code> and void <code>DoSomething(object o)</code>  but what is the major difference between initializations of <code>tTwo</code> and <code>tFour</code> using the same(?) anonymous method? I have been trying to find answer for a while but did not succeed.
  Thanks</p>