Which of the followidng statements are true. a.All the threads created in a class come to an end at the same time. b.You can stop a thread indefinitely if u wish to. c.You can start a thread only by extending the Thread class d.multiple threads accessing a method will lead to producing junk. e.JVM exits after the main() thread is exited even if there might be some threads running Is 'd' right or wrong ? I think the right answers are : b, e
e. is wrong. JVM usually exits only when all user threads finish. d. multiple threads accessing a method will lead to producing junk is ambiguous. You can say that multiple threads accessing a method of the same object might produce junk (unpredictable results) if no proper synchronization is done
I think that B is ambiguous too, because you can stop a thread with interrupt if you have it sleeping or waiting (correct me if I am wrong) About e: Look at the setDaemon definition.: the JVM finishes when there are non Daemon threads not running. Threads that are non Daemon are called user threads.