Given:
1. public class Pass {
2. public static void main(String [] args) {
3. int x = 5;
4. Pass p = new Pass();
5. p.doStuff(x);
6. System.out.print(" main x = " + x);
7. }
8.
9. void doStuff(int x) {
10. System.out.print(" doStuff x = " + x++);
11. }
12. }
What is the result?
发布于 2021-02-15 03:24:29
【单选题】 A doStuff x = 6 main x = 6 B doStuff x = 5 main x = 5 C doStuff x = 5 main x = 6 D doStuff x = 6 main x = 5