Skip to content

Instantly share code, notes, and snippets.

@dlhartveld
Last active December 14, 2015 06:08
Show Gist options
  • Save dlhartveld/5039852 to your computer and use it in GitHub Desktop.
Save dlhartveld/5039852 to your computer and use it in GitHub Desktop.
An example of JDK 8 default methods.
public interface Person {
public abstract String getFirstName();
public abstract String getLastName();
public default String getDisplayableFullName() {
return getLastName() + ", " + getFirstName();
}
public abstract boolean isStudent();
public default boolean isNotStudent() {
return !isStudent();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment