1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
package pack02;
class MemberInner {
private int a = 10;
public int b =20;
protected static int c = 30;
static class Member {
public void disp() {
//System.out.println(a);
//System.out.println(b);
System.out.println(c);
}
}
}
public class InnerClassStatic {
public static void main(String[] args) {
// TODO Auto-generated method stub
MemberInner memberinner = new MemberInner();
MwmberInner.Member member = memberinner.new MemberInner();
MemberInner.Member member = new MemberInner.Member();
member.disp();
}
}
|
cs |
'Programming > [JAVA]' 카테고리의 다른 글
[JAVA] this call (0) | 2018.03.23 |
---|---|
[JAVA] Anonymous Inner Class 익명 내부 클래스 (0) | 2018.03.23 |
[JAVA] LocalInnerClass 로컬 내부 클래스 (0) | 2018.03.23 |
[JAVA] MemberInnerClass 멤버 내부 클래스 (0) | 2018.03.23 |
[JAVA] ArithmeticsException (0) | 2018.03.23 |