Question about the meaning of some code.
Hi. I have a question about some code from my book "Head First Java". The first method of the book, it says it is illegal. The second method the book says is legal, but I don't know how it relates to anything, especially to the first method above it. here are the two methods. (I tried to find getObject in the java documentation, but I can't find it)
method one:
Code:
public void go() {
Dog aDog = new Dog();
Dog sameDog = getObject(aDog);
}
Above, I don't understand what get getObject() does.
and here is method two, which I really don't understand in any way. LOL.
Code:
public Object getObject(Object o) {
return o;
}
I don't know how method two relates to method one as it doesn't mention anything about a Dog object. any help GREATLY appreciated. Thank you. Derek:D