For the below code, given answer as:
"other.join attempts to join two Threads" ... Please explain.
public class ThreadTest {
class InnerRun implements Runnable {
public void run() {
// do slow stuff
System.out.println ("Ren");
}
}
class InnerRunTwo implements Runnable {
Thread other;
InnerRunTwo(Thread t) {other = t;}
public void run() {
other.join();
System.out.println ("Stimpy");
}
}
void start() {
InnerRun ir = new InnerRun();
Thread t = new Thread(ir);
InnerRunTwo irr = new InnerRunTwo(t);
Thread h = new Thread(irr);
t.start();
h.start();
}
public static void main(
String[] args) {
ThreadTest tt = new ThreadTest();
tt.start();
}
}