Last active
April 4, 2016 09:18
-
-
Save ron623/a266925735c4ec97c252 to your computer and use it in GitHub Desktop.
NestCls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Nest; | |
public class NestCls { | |
// 非staticメンバ | |
int i = 0; | |
// staticなメンバ | |
static int a = 999; | |
// インナークラス(非static) | |
public class Inner { | |
// さらにインナーなクラス | |
class MoreInner{ | |
// さらに、さらにインナーなクラス | |
class MoreMoreInner{ | |
} | |
} | |
// 外側クラスのメンバを呼び出してみる | |
int test1 = i; // ふつーのめんば | |
int test2 = a; // staticなめんば | |
// staticなメンバ | |
// static int num = 1111; // ・・・・1 | |
// インナークラスのメソッド | |
public void innerMtd() { | |
System.out.println("インナーです"); | |
} | |
} | |
// staticな内部クラス | |
static class StaticCls { | |
// 外側クラスのメンバを呼び出してみる | |
// int test1 = i; // ふつーのめんば // ・・・・2 | |
int test2 = a; // staticなめんば | |
// staticなメンバ | |
static int num = 1111; // ・・・・1 | |
public void staticMtd() { | |
System.out.println("スタティックなんです"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment