Created
May 29, 2021 07:28
-
-
Save swetharnaik/2d4d50b0f470879228b969b66f26a3b7 to your computer and use it in GitHub Desktop.
Java 11 - Interface with private method
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 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