public class ViewPort
{
public class BaseView
{
}
public class MainView extends BaseView
{
....
}
public class SideView extends BaseView
{
....
}
}
public class MainClass
{
private ViewPort currentView;
public MainClass()
{
currentView = new ViewPort.MainView();
}
}
이럴경우
'com.program.ViewPort' is not an enclosing class
하지만 이렇게 하니까 해결은 되는군요.
public class MainClass
{
private ViewPort currentView;
public MainClass()
{
currentView = new ViewPort().new MainView();
}
}
또는
public class MainClass
{
private ViewPort currentView;
public MainClass()
{
ViewPort vp = new ViewPort();
currentView = vp.new MainView();
}
}
로 해야 합니다.
댓글 없음:
댓글 쓰기