The main thread may exit before any threads it has created. If at least one of those threads is not a daemon thread and is alive, the application will not exit, and the other threads (daemon or not) will continue to run.
The GC thread is not 'daemon thread of main thread'. It's just a daemon thread. It will exit - along with all other daemon threads - when there are no non-daemon threads alive. Until then, it will continue and collect garbage.