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
4 changes: 3 additions & 1 deletion src/Author.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.ArrayList;
import java.util.List;

@SuppressWarnings("unchecked")
public class Author extends Person {
private List books;

Expand All @@ -28,8 +29,9 @@ public void addBook(String book) {
books.add(book);
}


@Override
public String sortName() {
public String fullName() {
return String.format("%s, %s", lastName, firstName);
}
}
2 changes: 2 additions & 0 deletions src/Main.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@SuppressWarnings("deprecation")
public class Main {

public static void main(String[] args) {
Author author = new Author("Sandi", "Metz");

Expand Down
1 change: 1 addition & 0 deletions src/Person.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/

public class Person {
protected String firstName;
protected String lastName;
Expand Down