package fuxi1;
//java的参数传递机制
public class Test3 {
//静态方法
// public static void swap(int a,int b){
//非静态方法
public void swap(int a, int b) {
int temp = a;
a = b;
b = temp;
System.out.println(a);
System.out.println(b);
}
public static void main(String[] args) {
Test3 s = new Test3();
int a = 6;
int b = 9;
//静态方法调用 属于类
//swap(a,b);
//非静态方法调用 对象调用
s.swap(a, b);
System.out.println(a);
System.out.println(b);
}
}