If the return statement is executed in a thread start function the thread is stopped in java
2 answers
Yes, a Java thread stops when its method ends run
.
Now this information is, say, "general knowledge", since the purpose of a class Thread
is to wrap a piece of code and exit when the code is done executing.
There is no explicit way to assert this behavior by examining the java.lang.Thread source code , since at some point the native method is called Running start0
.
+5
source to share