KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > InnerCompat


1 /* InnerCompat Copyright (C) 1999 Jochen Hoenicke.
2  *
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2, or (at your option)
6  * any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; see the file COPYING. If not, write to
15  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
16  *
17  * $Id: InnerCompat.java,v 1.3 1999/08/19 15:16:59 jochen Exp $
18  */

19
20
21 public class InnerCompat {
22     int x;
23
24     private class privateNeedThis {
25     void a() { x = 5; }
26     }
27     protected class protectedNeedThis {
28     void a() { x = 5; }
29     }
30     class packageNeedThis {
31     void a() { x = 5; }
32     }
33     public class publicNeedThis {
34     void a() { x = 5; }
35     }
36     private class privateNeedNotThis {
37     int x;
38     void a() { x = 5; }
39     }
40     protected class protectedNeedNotThis {
41     int x;
42     void a() { x = 5; }
43     }
44     class packageNeedNotThis {
45     int x;
46     void a() { x = 5; }
47     }
48     public class publicNeedNotThis {
49     int x;
50     void a() { x = 5; }
51     }
52
53     private static class privateStatic {
54     int x;
55     void a() { x = 5; }
56     }
57     protected static class protectedStatic {
58     int x;
59     void a() { x = 5; }
60     }
61     static class packageStatic {
62     int x;
63     void a() { x = 5; }
64     }
65     public static class publicStatic {
66     int x;
67     void a() { x = 5; }
68     }
69 }
70
Popular Tags