Can a Static method access a private method of the same class?

前端 未结 5 1291
一个人的身影
一个人的身影 2020-12-10 01:15

I have this question because of the singleton/named constructor. In both cases, the real constructors are protected or private, neither of which can be accessed from outside

5条回答
  •  生来不讨喜
    2020-12-10 01:54

    Your static method is not accessing any static member nor any non-static member of an existing instance.
    It's just creating a new instance.

提交回复
热议问题