author | mcimadamore |
Wed, 26 Oct 2016 15:41:25 +0100 | |
changeset 41856 | 13a056e8f16e |
parent 40835 | 6ab9ed1abc46 |
child 41931 | d7c9720c4223 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
2 |
* @test /nodynamiccopyright/ |
|
3 |
* @bug 5003235 |
|
4 |
* @summary Accessibility of private inner class |
|
5 |
* @author Peter von der Ah\u00e9 |
|
40835
6ab9ed1abc46
8162546: change hidden options -Xdebug to --debug, -XshouldStop to --should-stop, and -diags to --diags
vromero
parents:
39812
diff
changeset
|
6 |
* @compile/fail/ref=T5003235b.out --diags:layout=%b:%l:%_%m T5003235b.java |
10 | 7 |
*/ |
8 |
||
9 |
class Outer { |
|
10 |
public Inner inner; |
|
11 |
||
12 |
public void create() { |
|
13 |
inner = new Inner(); |
|
14 |
} |
|
15 |
||
16 |
private class Inner { |
|
17 |
int k = 100; |
|
18 |
protected int l = 100; |
|
19 |
public int m = 100; |
|
20 |
protected int n = 100; |
|
21 |
} |
|
22 |
} |
|
23 |
||
24 |
class Access { |
|
25 |
public static void main(String[] args) { |
|
26 |
Outer outer = new Outer(); |
|
27 |
outer.create(); |
|
28 |
System.out.println("Value of k: " + outer.inner.k); |
|
29 |
System.out.println("Value of l: " + outer.inner.l); |
|
30 |
System.out.println("Value of m: " + outer.inner.m); |
|
31 |
System.out.println("Value of n: " + outer.inner.n); |
|
32 |
} |
|
33 |
} |