Skip to content

Instantly share code, notes, and snippets.

@swetharnaik
Created May 29, 2021 07:28
Show Gist options
  • Save swetharnaik/2d4d50b0f470879228b969b66f26a3b7 to your computer and use it in GitHub Desktop.
Save swetharnaik/2d4d50b0f470879228b969b66f26a3b7 to your computer and use it in GitHub Desktop.
Java 11 - Interface with private method
public interface Calculate {
default int doCalculation(int n, int error) {
return randomCalculations(n, error);
}
private int randomCalculations(int someNo, int error) {
return someNo*someNo-error*error;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment