Created
March 21, 2015 07:36
-
-
Save aruld/9d21eb152f75493206db to your computer and use it in GitHub Desktop.
cannot reduce visibility of private methods
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 class VisibilityTest { | |
interface I { | |
private void foo(int x) {} | |
private void bar(int x) {} | |
} | |
interface J extends I { | |
void foo(int x); // Valid: public abstract method with the same signature as a private method in super type is allowed. | |
default void bar(int x) {} // Valid: public default method with the same signature as a private method in super type is allowed. | |
} | |
interface K extends J { | |
private void foo(int x) {} // Invalid: attempting to assign weaker access privileges | |
private void bar(int x) {} // Invalid: attempting to assign weaker access privileges | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment