the value of the object is passed into the method, but the method still needs a way to refer to the object. the reference to the object that the method uses is different from the reference to the object that is given.
psvm(String[] args) {
Foo f = new Foo(); //f is a reference to the value given by new Foo()
doSomething(f); // java will take the value given by the reference f (namely the value of that new Foo) and pass it to doSomehing()
}
static void doSomething(Foo f) {
f.doAThing(); //in order for the programmer to do something with that value inside of the method though, the programmer needs a way to reference it inside of the method. Thus, the method is using a different reference to the same value
}
This was roughly how it was explained to me in my AP CS course. if i missed anything, someone correct me