can we override start method in thread?

start() method

public void start()

It starts thread to begin execution, JVM calls run method of this thread.
IllegalThreadStateException – if the thread was already started.

We can override the start method in thread. But when we class thread.start() method then overrided method will be called which results into no execution of run method. Hence no job will be performed.

So, we do not have to override the start method.

Note: We can call super class start method in overrided start method to invoke run method.

Content Protection by DMCA.com
Please Share