Thank you guys........I was just curious as to how references worked....that's all..........I just used the Mammal class as an example.....
Some while back, I was working w/ arrays, and was trying to call a method that would change the size of an existing array...this method existed in a different class so I had to pass the array(whose size I wanted to change) as a parameter. Inside the method, I defined a temporary array (bigger array), copied all the values from the array that was passed, and then simply pointed the array (formal parameter) to the temp array. But ofcourse, the original array (actual parameter) did not point to the temp array (the bigger array). I figured out another way.....but then I became curious as to if there was a way in java which would allow this.....
By creating aliases, I can certainly change the state of an object, but I can't make one point to a new object (and have the other one automatically point to the new object as well).
however, Arrays.copyOf already does that for you ;-)
JDBCSupport - An easy to use, light-weight JDBC framework -
Joined: Jan 17, 2010
Joe it was an assignment, so I had to come up with my own class.....and array........couldn't use ArrayList,
Sebastian, that is exactly how I did it after discovering my original method didn't work......