How does access modifier impact the performance in Java?

后端 未结 2 1147
南旧
南旧 2021-01-27 00:08

In java programming, method level access modifiers using protected or public where private can be used will affect the performance in any way? if so in what what way it affects

2条回答
  •  时光说笑
    2021-01-27 00:32

    Quoting erickson from the following answer:

    The access modifier on the field doesn't make any difference in speed, but invoking the accessor method does.

    ps. Please upvote the original answer instead of this one.

提交回复
热议问题