I don´t get what we've done here with the Keyword return . I haven't seen it in such use before:
public MarkTwainBook getBook() {
return this;
}
is it as if we did like this ? :
public MarkTwainBook getBook() {
return new MarkTwainBook();
}
i tried it and i guess i´m wrong , so i would like to know its functionality
kurz Frage
Gelöst
return this;
returns the current object as this refernces exectly that whilereturn new MarkTwainBook();
would return the refernce to a newly created MarkTwainBook object.