|
Java example source code file (InterfaceMemberClassModifiers.java)
The InterfaceMemberClassModifiers.java Java example source code/* * @test /nodynamiccopyright/ * @bug 4294065 4785453 * @summary Verify that invalid access modifiers on interface members don't cause crash. * @author maddox * * @compile/fail/ref=InterfaceMemberClassModifiers.out -XDdiags=%b:%l:%_%m InterfaceMemberClassModifiers.java */ public interface InterfaceMemberClassModifiers { Object nullWriter = null; class SomeClass1 implements InterfaceMemberClassModifiers { // OK public Object getOut() { return nullWriter; } } public class SomeClass2 implements InterfaceMemberClassModifiers { // OK public Object getOut() { return nullWriter; } } // Compiler used to crash on these! (after reporting error) protected class SomeClass3 implements InterfaceMemberClassModifiers { // illegal public Object getOut() { return nullWriter; } } private class SomeClass4 implements InterfaceMemberClassModifiers { // illegal public Object getOut() { return nullWriter; } } } Other Java examples (source code examples)Here is a short list of links related to this Java InterfaceMemberClassModifiers.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.