静态方法或类 [英] static methods or classes

查看:81
本文介绍了静态方法或类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在学习静态方法和类...
阅读了几篇文章,书籍等后,我得出以下结论:
您是否同意每一点?

谢谢

1-静态成员不能通过实例变量进行引用.
2-静态成员可以是抽象的吗?
3-此关键字不能在静态方法中使用
4-常量修饰符中不使用静态修饰符
5-类的每个实例可以有一个静态字段的副本.

Hi,
I am in the process of learning about static methods and classes...
After reading several articles, books, etc. I have concluded the following:
Do you agree with each point?

Thank you

1- Static members can not be references through instance variables.
2- static members can be abstract?
3- this keyword can not be used in static methods
4- static modifiers are not used in constant declaration
5- there can be a copy of a static field for each instance of a class.

推荐答案

1)是.
2)号
3)是的.
4)是的.
5)不.
1) yes.
2) no.
3) yes.
4) yes.
5) no.


要进一步阅读,

静态类和静态类成员 [
For further reading,

Static Classes and Static Class Members[^]

:)


这篇关于静态方法或类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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