How to create objects from a class with private constructor?

前端 未结 6 1528
花落未央
花落未央 2021-01-14 00:39

I have a class Game that is my main class and a second class Card. Class Card hast its properties and constructor private, only function init is public. Function init checks

6条回答
  •  说谎
    说谎 (楼主)
    2021-01-14 01:13

    Note : You can access private constructor from within the class itself as in a public static factory method.
    You can access it from the enclosing class it its a nested class.

提交回复
热议问题