下面代码输出结果是: public class Demo { static int j=20; public static void main(String[] args) { int i=10; Demo p=new Demo(); p.mathod(i); System.out.println(i+"and"+j); } public void mathod(int x) { x=x*2; j=j*2; } }
选项:
A:10 and 40
B:错误,方法参数与变量不匹配
C:20 and 40
D:10 and 20
发布时间:2024-04-22 18:03:57