123456789101112131415



Question 1: public class TestOne implements Runnable {
public static void main (String[] args) throws Exception {
Thread t = new Thread(new TestOne());
t.start();
System.out.print("Started");
t.join();
System.out.print("Complete");
}
public void run() {
for (int i = 0; i < 4; i++) {
System.out.print(i);
}
}
}

What can be a result?

1. Compilation fails.
2. An exception is thrown at runtime.
3. The code executes and prints "StartedComplete0123".
4. The code executes and prints "Started0123Complete".