Accessing class member from static method

后端 未结 3 771
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-11 07:30

I know there are a lot of threads talking about this but so far I haven\'t found one that helps my situation directly. I have members of the class that I need to access fro

3条回答
  •  囚心锁ツ
    2020-12-11 08:22

    How would you suggest I get Summary from either type of method?

    You'll need to pass myCool to DoSomeOtherMethod - in which case you should make it an instance method to start with.

    Fundamentally, if it needs the state of an instance of the type, why would you make it static?

提交回复
热议问题