【Java开源代码栏目提醒】:网学会员鉴于大家对Java开源代码十分关注,论文会员在此为大家搜集整理了“VariablePassTest1.java”一文,供大家参考学习
import school.*;
public class VariablePassTest1
{
public static void main(String arg[])
{
Student s1 = new Student("John");
System.out.println("Before call changeValue(s1), name=" + s1.getName());
changeValue(s1);
System.out.println("After call changeValue(s1), name=" + s1.getName());
}
public static void changeValue(Student s1)
{
s1.setName("Williams");
}
}