Java Thread activeCount() methodThe activeCount() method of thread class is used to return the number of active threads in the current thread's thread group. The value returned is only an estimate because the number of threads may change dynamically while this method traverses internal data structures. SyntaxReturnIt returns the number of active threads in the current thread's thread group. ExampleTest it NowOutput: number of active thread: 2 running thread name is: Thread-1 running thread name is: Thread-2 Next TopicMultithreading Java |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India