“公开"与“公开"之间的区别在于和“公共静态"? [英] The difference between "public" and "public static"?
本文介绍了“公开"与“公开"之间的区别在于和“公共静态"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
static
是什么意思?
我知道public
意味着可以从类外部访问它,而private
仅可以从类内部访问…
I know public
means that it can be accessed from outside the class, and private
only from inside the class…
推荐答案
静态表示无需实例化类即可对其进行访问.这对常量很有用.
Static means that it can be accessed without instantiating a class. This is good for constants.
静态方法无需影响对象的状态.除了参数外,它们还可以具有局部变量.
Static methods need to have no effect on the state of the object. They can have local variables in addition to the parameters.
这篇关于“公开"与“公开"之间的区别在于和“公共静态"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文