Ask Your Question
2

If we do not override the run method of the Thread class, what will be the impact on its state? Will its state remain the same or undergo changes?

asked 2021-07-01 11:00:00 +0000

david gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-10-30 05:00:00 +0000

pufferfish gravatar image

If we do not override the run method of the Thread class, the state of the thread will not change. However, the thread will not execute any logic and will terminate immediately after it is started. By default, the run method of the Thread class is an empty method. Therefore, it is necessary to override the run() method and place the logic which the thread should execute in it.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-07-01 11:00:00 +0000

Seen: 13 times

Last updated: Oct 30 '22