首页 试题广场 > 试题详情
单选题

What will happen when you attempt to compile and run the following code?public class Test{static{   int x=5;}static int x,y;public static void main(String args[]){   x--;   myMethod( );   System.out.println(x+y+ ++x);}public static void myMethod( ){  y=x++ + ++x; }}

  • A.compiletime error
  • B.prints:1
  • C.prints:2
  • D.prints:3
提交并查看答案
下一题 上一题
Ke星伙伴们的回答/ 5个回答
关闭
关闭
QQ
交流群
邀请
好友
App
下载
意见
反馈
返回
顶部