Given: public class Pass { public static void main(String [] args) { int x 5; Pass p = new Pass(); p.doStuff(x); System.out.print(” main x = “+ x); } void doStuff(int x) { System.out.print(” doStuff x = “+ x++); } } What is the result?
doStuffx = 5 main x = 5
Compilation fails.
doStuffx = 6 main x = 5
An exception is thrown at runtime
doStuffx = 6 main x = 6