访问修饰符如何影响Java中的性能? [英] How does access modifier impact the performance in Java?

查看:112
本文介绍了访问修饰符如何影响Java中的性能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在java编程中,使用protected或public的方法级访问修饰符可以以任何方式影响性能吗?如果是这样,它会以什么方式影响运行时性能。

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 the run time performance.

推荐答案

引用以下答案的com / users / 3474 / erickson> erickson :

Quoting erickson from the following answer:


字段上的访问修饰符在
速度上没有任何区别,但是调用访问器方法

ps。请提供原始答案而不是此答案。

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

这篇关于访问修饰符如何影响Java中的性能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆