Java ThreadGroup list() methodThe list() method of ThreadGroup class is used to display the information about the thread group. It is useful only for debugging. SyntaxReturnThis method does not return any value. ExampleTest it NowOutput: Thread-1 starts Thread-2 starts Listing parentThreadGroup: Parent thread: java.lang.ThreadGroup[name=Parent thread,maxpri=10] Thread[Thread-1,5,Parent thread] Thread[Thread-2,5,Parent thread] java.lang.ThreadGroup[name=Child thread,maxpri=10] Thread-1 completed executing Thread-2 completed executing
Next TopicMultithreading Java
|