123456789101112131415



Question 1: public class Tea {
public static void main(String [] args) {
int x = 5;
Tea t = new Tea();
t.doStuff(x);
System.out.print(" main x = " + x);
}

void doStuff(int x) {
System.out.print(" doStuff x = " + x++);
}
}

What is the result?

1. Compilation fails.
2. An exception is thrown at runtime.
3. doStuff x = 6 main x = 6
4. doStuff x = 5 main x = 5