/
githubmirror
/
panama-vector
Обзор
Документация
Войти
/
githubmirror
/
panama-vector
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/langtools/tools/javac/defaultMethods/private/Private03.java
27 строк
837 B
Erik Joelsson
8187443: Forest Consolidation: Move files to unified layout
12 сен 2017, 20:03
12 сен 2017, 20:03
3789983
Код
Авторство
О чём код?
/* * @test /nodynamiccopyright/ * @bug 8071453 * @author sadayapalam * @summary Various tests for private methods in interfaces. * @compile/fail/ref=Private03.out -XDrawDiagnostics Private03.java */ public class Private03 { interface I { private void foo(int x) {} private void goo(int x) {} } interface J extends I { // Verify that we are able to declare a public abstract method with the same signature as a private method in super type. void foo(int x); // Verify that we are able to declare a public default method with the same signature as a private method in super type. default void goo(int x) {} } interface K extends J { private void foo(int x) {} // Error, cannot reduce visibility private void goo(int x) {} // Ditto. } }