Java — Multithreading Enhancement | Code Factory

package com.example.thread;public class Test {
public static void main(String... args) {
System.out.println(Thread.currentThread().getThreadGroup().getName()); // main
System.out.println(Thread.currentThread().getThreadGroup().getParent().getName()); // system

//Thread.currentThread() --> main thread
//Thread.currentThread().getThreadGroup() --> main thread group
//Thread.currentThread().getThreadGroup().getParent() --> system thread group
}
}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store