static 중첩 클래스
static 중첩 클래스
static 중첩 클래스의 형태
public class Outer {
static class Inner {//static 중첩 클래스(접근 제한 설정 자유)
}
}static 중첩 클래스의 활용 예시
public class Phone {
public static class Display {
}
public static class Button {
}
public static class Camera {
}
public static class Usim {
}
}public class InnerClassExample03 {
public static void main(String[] args){
Phone.Display display = new Phone.Display();
Phone.Camera camera = new Phone.Camera();
Phone.Button button = new Phone.Button();
Phone.Usim usim = new Phone.Usim();
}
}Last updated