i went through several post in stackoverflow and googled other good sites to understand the concepts of java pass by value..
my doubt goes as below.
Dog someDog = new Dog("FOO"); //mem location 42
foo(someDog);
someDog.setName("FIFI"); // false
foo(Dog newDog){
newDog.name.equals("FOO"); //true
newDog = new Dog("FIFI"); // create a new DOG object mem location 72. my doubt here
newDog.name.equals("FIFI"); //true
}
so as above in the line newDog = new Dog("FIFI");
my understanding goes new DOG object is created at mem location 72 and assigned to another Dog location object at mem location 42.
what does it means? at the background..
Regards Punith.