Advantages to Using Private Static Methods

后端 未结 8 2359
南笙
南笙 2020-11-27 09:52

When creating a class that has internal private methods, usually to reduce code duplication, that don\'t require the use of any instance fields, are there performance or mem

8条回答
  •  鱼传尺愫
    2020-11-27 10:13

    Yes, the compiler does not need to pass the implicit this pointer to static methods. Even if you don't use it in your instance method, it is still being passed.

提交回复
热议问题