By those definitions, Java is always pass-by-value. Unfortunately, when we deal with variables holding objects we are really dealing with object-handles called references which are passed-by-value as well. ThisThis terminology and semantics easily confuse many beginners.
In this example, aDog.getName() will still return "Max". The value aDog within main is not changed in the function foo by creating new Dog with name member variable set to "Fifi" because the object reference is passed by value. If the object reference waswas passed by reference, then the aDog.getName() in main would return "Fifi" after the call to foo.