Is not an enclosing class Java

后端 未结 11 2579
轻奢々
轻奢々 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 02:13

    Suppose RetailerProfileModel is your Main class and RetailerPaymentModel is an inner class within it. You can create an object of the Inner class outside the class as follows:

    RetailerProfileModel.RetailerPaymentModel paymentModel
            = new RetailerProfileModel().new RetailerPaymentModel();
    

提交回复
热议问题