passtest.java
来自「矩阵乘法的计算程序」· Java 代码 · 共 36 行
JAVA
36 行
/**
* This class can take a variable number of parameters on the command
* line. Program execution begins with the main() method. The class
* constructor is not invoked unless an object of type 'Class1'
* created in the main() method.
*/
public class PassTest
{
float ptValue;
public static void main (String[] args)
{
int val;
PassTest pt=new PassTest() ;
val=11;
System.out.println(val);
pt.ChangeInt(val);
System.out.println("Int Value after Change is:"+val);
pt.ptValue =101f;
System.out.println("Original ptValue is:"+pt.ptValue );
pt.ChangeObjValue(pt);
System.out.println("ptValue after Change is:"+pt.ptValue );
}
private void ChangeInt(int value){
value=55;
}
public void ChangeObjValue(PassTest ref){
ref.ptValue=99f;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?