Is not an enclosing class Java

后端 未结 11 2596
轻奢々
轻奢々 2020-11-28 01:41

I\'m trying to make a Tetris game and I\'m getting the compiler error

Shape is not an enclosing class

when I try t

11条回答
  •  孤街浪徒
    2020-11-28 01:56

    No need to make the nested class as static but it must be public

    public class Test {
        public static void main(String[] args) {
            Shape shape = new Shape();
            Shape s = shape.new Shape.ZShape();
        }
    }
    

提交回复
热议问题