Given the command line java Pass2 and: public class Pass2{ public void main(String[]args){ int x=6; Pass2 p=new Pass2(); p.doStuff(x); System.out.print("mainx="+x); } void doStuff(intx){ System.out.print("doStuffx="+x++); } } What is the result?()

A . Compilation fails. B . An exception is thrown at runtime. C . doStuffx=6 main x=6 D . doStuffx=6 mainx =7 E . doStuffx=7 mainx =6 F . doStuffx=7 mainx =7

时间:2022-11-01 03:24:12 所属题库:Java认证考试综合练习题库

相似题目