Earlier quoted context omitted.
In Java, this code will print the string representation of Lassie: Dog toby = new Dog("Toby"); public static void replaceDogWithToby ( Dog d ) { d = toby; } public static void main ( String[] args ) { Dog d = new Dog("Lassie"); replaceDogWithToby(d); System.out.println(d); } In Pascal, this will print Toby: var toby:tDog; procedure replaceDogWithToby ( var d:tDog ); begin d := toby; end; var lassie:tDog; begin {code…
I haven't done java in a long time so I won't try to debate the specific language level semantics with you (the same is true of pascal though it has been even longer), however assuming that your examples run and behave as you describe then what is going on in the java example is that 'Dog d' is passed as a reference to a reference, and then the value pointed to by the argument, i.e. the address of "toby," is replaced…
No fancy pointer-to-pointer business thus.
No idea what's going on Pascal, though, have to check out myself.
upd: upon checking http://wiki.freepascal.org/Variable_parameter , I suspect that here a pointer is passed underneath again, but the assignment now copies the bytes over into the pointed-to object.