Am I right in assuming that if I null a Thread, it is cleaned up by garbage collection thus in effect killed? I understand, they actually persist, but an article by Bill Verners on JavaWorld claims that when objects have no reference they are cleaned up by the garbage colletor.
Please help me understand this because I'm writing an app, for which if I keep nulling my Threads and they aren't exactly cleaned up, my application will turn nasty really fast.
Nulling a thread reference does not cause the thread to stop running.
Threads are obviously a special type of object. After starting they are under control of the VM so they can be executed. The VM will hold references to the thread until it stops running. You can receive a list of threads active in the VM via the Thread class itself.
Killing a thread is not really possible unless you design for it in your thread code. Two general ways to investigate are the interrupt() method and relatives from Thread or implementing a simple boolean stop value.