In my program, I am creating several threads in the main() method. The last line in the main method is a call to System.out.println(), which I don\'t want to call until all
You could wait() in your main thread and have all threads issue a notifyAll() when they're done. Then each time your main thread gets woken up that way, it can check if there's at least one thread that's still alive in which case you wait() some more.