欢迎来到求知题库网 求知题库官网
logo
全部科目 > Java认证考试 > SCJP程序员认证考试

单项选择题

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(” main x = “+ x);
} 
void doStuff(int x) { 
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 main x = 7
    E. doStuffx = 7 main x = 6
    F. doStuffx = 7 main x = 7

点击查看答案&解析

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题