123456789101112131415



Question 1: Which one code fragments will execute the method doStuff() in a separate
thread?

1. new Thread() {
public void run() { doStuff(); }
};
2. new Thread() {
public void start() { doStuff(); }
};
3. new Thread() {
public void start() { doStuff(); }
}.run();
4. new Thread() {
public void run() { doStuff(); }
}.start();