am i implementing this code right? my output doesnt take effect of join() usage at all. "Lucy" would come out before Fred does!
join() causes the calling thread to wait until the completion of the thread represented by the Thread object. In your example, it will cause the main thread (the thread executing the main method) to wait for the completion of thread two. Thread one runs independently of the other two threads (main and two).