callbyref.java
来自「it is a good tool to help you study java」· Java 代码 · 共 19 行
JAVA
19 行
class Test{
int a,b;
Test(int i,int j){
a=i;
b=j;
}
void meth(Test o){
o.a*=2;
o.b/=2;
}
}
class CallByRef{
public static void main(String args[]){
Test ob =new Test(15,20);
System.out.println("ob.a and ob.b before call"+ob.a+" "+ob.b);
ob.meth(ob);
System.out.println("ob.a and ob.b after call"+ob.a+" "+ob.b);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?