I think I understand that it is a copy of the object/data member passed into the method tricky(), as only the value is what matters, not the actual object itself. But the print statements assure me that arg1 and arg2, the copies, are indeed switched within the method. I don't understand why this wouldn't relay the information back to original objects, consequently switching them; Seeing as the method is able to successfully access the arg1.x and arg1.y data members within the method.
// This class demonstrates the way Java passes arguments by first copying an existing
// object/data member. This is called passing by value. the copy then points(refers)
// to the real object
// get the point class from abstract window toolkit
import java.awt.*;
public class passByValue {
static void tricky(Point arg1, Point arg2){
  arg1.x = 100;
  arg1.y = 100;
  System.out.println("Arg1: " + arg1.x + arg1.y);
  System.out.println("Arg2: " + arg2.x + arg2.y);
  Point temp = arg1;
  arg1 = arg2;
  arg2 = temp;
  System.out.println("Arg1: " + arg1.x + arg1.y);
  System.out.println("Arg2: " + arg2.x + arg2.y);
}
public static void main(String [] args){
  Point pnt1 = new Point(0,0);
  Point pnt2 = new Point(0,0);
  System.out.println("X1: " + pnt1.x + " Y1: " +pnt1.y); 
  System.out.println("X2: " + pnt2.x + " Y2: " +pnt2.y);
  System.out.println(" ");
  tricky(pnt1,pnt2);
  System.out.println("X1: " + pnt1.x + " Y1:" + pnt1.y); 
  System.out.println("X2: " + pnt2.x + " Y2: " +pnt2.y);  
}
}
 
     
     
     
     
     
     
    