In a game I’m making I use many instances of a thread, and it does not keep track of them.
clientThread cT = new clientThread(socket);
new Thread(cT).start();
What I need to know is that when an instance of the tread has finished(all the loops have been completed and it is no longer being used), just like an instance of a method, is it discarded? Or do I need to use a special piece of code to discard it?
The thread is a normal object, which will be garbage collected like any other object. In the case of a thread object, it becomes eligible for collection when the thread exits.