Skip to content

Instantly share code, notes, and snippets.

@sankars
Created April 11, 2014 17:09
Show Gist options
  • Select an option

  • Save sankars/10484914 to your computer and use it in GitHub Desktop.

Select an option

Save sankars/10484914 to your computer and use it in GitHub Desktop.
// http://stackoverflow.com/questions/22713652/can-an-interface-method-have-a-body
// define static method
interface Whoa {
public static void doStuff() {
System.out.println("This is not default implementation");
}
}
// define default implementation for a method
default public ZonedDateTime getZonedDateTime(String zoneString) {
return ZonedDateTime.of(getLocalDateTime(), getZoneId(zoneString));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment