Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8615463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:23:02+00:00 2026-06-12T05:23:02+00:00

Possible Duplicate: What is the difference between new Thread(void Target()) and new Thread(new ThreadStart(void

  • 0

Possible Duplicate:
What is the difference between new Thread(void Target()) and new Thread(new ThreadStart(void Target()))?

I have a small question about Thread class. This class has 4 constructors:

public Thread(ParameterizedThreadStart start);
public Thread(ThreadStart start);
public Thread(ParameterizedThreadStart start, int maxStackSize);
public Thread(ThreadStart start, int maxStackSize);

I use the 2nd constructor to create a Thread object:

Thread thread = new Thread(new ThreadStart(ScanDirectory));

However, I can use a way to create this object without using any constructors I talk above.

Thread thread = new Thread(ScanDirectory);

In this case, ScanDirectory is a void method, it isn’t ThreadStart or ParameterizedThreadStart but Thread class still accepts this constructor. Why?
I think this is a .NET feature but I don’t know how it’s implemented.

Note: ScanDirectory is a void method.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T05:23:03+00:00Added an answer on June 12, 2026 at 5:23 am

    It’s important to separate two things here:

    • The call to the Thread constructor
    • The creation of a delegate to pass to the Thread constructor

    You’re really interested in the latter here – the difference between:

    ThreadStart tmp = new ThreadStart(ScanDirectory);
    

    and

    ThreadStart tmp = ScanDirectory;
    

    The second of these is a method group conversion – an implicit conversion from a method group (the name of a method, possibly qualified by an instance value if it’s an instance method) to a delegate with a compatible signature.

    You very rarely need the “explicit” delegate creation expression of the first form, since method group conversions were introduced in C# 2. You’ll see a lot of code which still uses it because many developers are unaware of method group conversions, unfortunately – and IIRC the Visual Studio designers still uses that form for event handler subscription.

    The only time you’d really need it was when the method group conversion ended up being ambiguous. For example:

    static void Main()
    {
        // Valid: uses parameterless overload
        new Thread(new ThreadStart(Foo));
    
        // Valid: uses parameterized overload
        new Thread(new ParameterizedThreadStart(Foo));
    
        // Invalid, as there are two valid constructor overloads
        new Thread(Foo);
    }
    
    static void Foo()
    {
    }
    
    static void Foo(object state)
    {
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Difference between Color.red and Color.RED I have seen that the Java class
Possible Duplicate: Difference between class property mVar and instance variable self.mVar I am new
Possible Duplicate: difference between destructor and garbage collector Recently i asked this question ,
Possible Duplicate: What is difference between instantiating an object using new vs. without This
Possible Duplicate: Difference between self.ivar and ivar? Let's say I have the following class
Possible Duplicate: new MyObject(); vs new MyObject; What is the difference between new Object
Possible Duplicate: Difference between void main and int main? Why is void main() {
Possible Duplicate: difference between string object and string literal Let's say I have two
Possible Duplicate: difference between throw and throw new Exception() I'm a programmer working on
Possible Duplicate: Difference Between Equals and == For example, if I have MyClass foo

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.