Skip to content

Instantly share code, notes, and snippets.

@jellybob
Last active January 21, 2019 12:40
Show Gist options
  • Save jellybob/acfd242a8e1cec151ec231226c3a4607 to your computer and use it in GitHub Desktop.
Save jellybob/acfd242a8e1cec151ec231226c3a4607 to your computer and use it in GitHub Desktop.
public String toString() {
String message = "The book, " + title + " was written by " + getAuthorName() + " it is " + pageCount() + " pages long.";
if (!this.author.alive) {
message = message + " It will become public domain in " + getYearsToPublicDomain() + " years.";
}
return message;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment