When does a typical Java app finish?
If I start a new thread in the main
method and then the main
method finishes, but the other thread continues working, the app would still be on until all it's threads have died, wouldn't it?
Thanks & Merry Christmas!
Yes, unless it's a deamon thread. Quoting from Thread API:
The main() function defines your main user thread. You might have other user threads that you created as well. You might also have called setDeamon() on some of those threads.
The JVM will end when: