Created
March 9, 2018 07:28
-
-
Save kunals201/e5c5ef57df136cb84f347cdf3dfb1c61 to your computer and use it in GitHub Desktop.
Java9 interface private methods example
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
interface Util { | |
default int numberOfStudents() { | |
return helper(); | |
} | |
private int helper() { | |
return 10; | |
} | |
static int getCores() { | |
return helper1(); | |
} | |
private static int helper1() { | |
return 2; | |
} | |
} | |
public class Sample { | |
public static void main(String[] args) { | |
System.out.println("OK"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment