What happens if we don’t override run() method during thread creation using extended thread?

(Last Updated On: January 1, 2015)

Answer:

If we don’t override run() method, compiler will not flash any error and it will execute run() method of Thread class that has empty implemented, So, there will be no output for this thread.

Below example will not provide any output

 

 

Notes:

This is one of the advantages of Runnable interface over extending Thread class. Runnable interface forces you to override run() method.