Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/Author.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
import java.util.ArrayList;
import java.util.List;


public class Author extends Person {
private List books;
private List<String> books;

public Author(String firstName, String lastName) {
super(firstName, lastName);
Expand All @@ -29,7 +30,7 @@ public void addBook(String book) {
}

@Override
public String sortName() {
public String fullName() {
return String.format("%s, %s", lastName, firstName);
}
}
}
4 changes: 2 additions & 2 deletions src/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ public static void main(String[] args) {
author.addBook("Practical Object-Oriented Design in Ruby");
author.addBook("99 Bottles of OOP");

for (String book: author.getBooks()) {
for (String book: author.publishedBooks()) {
System.out.println(book);
}
}
}
}
2 changes: 1 addition & 1 deletion src/Person.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ public Person(String firstName, String lastName) {
public String fullName() {
return String.format("%s %s", firstName, lastName);
}
}
}