Skip to content

Instantly share code, notes, and snippets.

@juliofalbo
Last active October 11, 2019 19:34
Show Gist options
  • Save juliofalbo/8fe7f8323ea65408f723776ba8b7493a to your computer and use it in GitHub Desktop.
Save juliofalbo/8fe7f8323ea65408f723776ba8b7493a to your computer and use it in GitHub Desktop.
interface SomeInterfaceJava8 {
Integer customCalc(int a, int b);
default Integer calc(int a, int b) {
return (a + b);
}
}
class SomeImplementationJava8 implements SomeInterfaceJava8 {
@Override
public Integer customCalc(int a, int b) {
return calc(a, b) + 1;
}
}
class AnotherImplementationJava8 implements SomeInterfaceJava8 {
@Override
public Integer customCalc(int a, int b) {
return calc(a, b) + 2;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment