요즘자바 이클립스를 공부하는 중인데
아래에
 public class CallByValueEx1
{
public static void swap(int x, int y)
{
int temp;
temp=x; x=y; y=temp;
 
System.out.println(" **교환*x="+x+",y="+y);
}
 
public static void main(String args[])
{
int x=100, y=500;
System.out.println("교환이전:x="+x+",y="+y);
 
swap(x,y);
System.out.println("교환이후:x="+x+",y="+y);
}
}

==============================================================

 
class Swap
{
public int x,y;
public static void swap(Swap ob)
{
int temp;
temp=ob.x; ob.x= ob.y; ob.y=temp;
 
System.out.println(" **교환*x="+ob.x+",y="+ob.y);
}
}
 
public class CallByReferenceEx1
{
public static void main(String args[])
{
Swap xy = new Swap();
xy.x=100; xy.y=500;
 
System.out.println("교환이전:x="+xy.x+",y="+xy.y);
Swap.swap(xy);
System.out.println("교환이후:x="+xy.x+",y="+xy.y);
}
}

이두놈을 합치려하는데 자꾸오류뜨는데 메인이 문제인것같아서 계속 지우고 추가해봤는데 제 지식으로는 해결이안되네요
좀도와주세요ㅠㅠ