Java面试题:请说出如下代码的输出结果
2023-07-06
public class Static
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;
答案:
答案:3
Java面试题:请说出如下代码的输出结果2023-07-06 public class Static 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; 答案: 答案:3 相关内容: |