I have wondered why ‘new Thread(new Thread(),”string”);’ is running correctly

The run() in Thread is empty, but it still exists. You start the thread, it has nothing to do (due to no run() method with logic available) and it will finish. Your example provides an instance of Thread as the Runnable parameter.

The syntax is correct, but naturally no program would start empty threads, so it’s a logical error.

Leave a Comment