Last active
December 14, 2015 06:08
-
-
Save dlhartveld/5039852 to your computer and use it in GitHub Desktop.
An example of JDK 8 default methods.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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