Sure.
The main thread is just one thread among others, and its termination will not affect other threads (unless you use System.exit() to stop the thread ...).
The main thread is only the first thread *) that was launched, but it does not have any additional or hidden functions or functionality.
*) to keep it simple: jvm may have started some internal threads before main, but the application does not have code for these threads
source share