当前位置:网站首页>Static domain and static method
Static domain and static method
2022-07-01 01:52:00 【Hades hadir】
Static domain
class Employee {
private static int nextId = 1;
private int id;
}
- Each employee object has its own id Domain , But all instances of this class share one nextId Domain
- namely , If there is 1000 individual Employee Class object , Then there are 1000 Instance fields Id, But there is only one static domain nextId
- Even if there is no employee object , Static domain nextId Also exist
- Static fields belong to classes , Does not belong to any independent object
- In most object-oriented programming languages , Static fields are called class fields
static const
- Very few static variables , But static constants are often used .
Static methods
- A method that cannot perform an operation on an object
Static methods don't have this Parameter method
- Static methods cannot access instance domains , But you can access static domains in your own classes
public static int getNextId(){
return nextId; //return static field
}
边栏推荐
- The personal test is effective, and the JMeter desktop shortcut is quickly created
- 远程办公如何保持高效协同,实现项目稳定增长 |社区征文
- electron之坑addon
- Batch import of Excel data in applet
- MYSQL 数据库查看磁盘占用情况
- 【agora】用户管理
- PHP通过第三方插件爬取数据
- How does ZABBIX configure alarm SMS? (alert SMS notification setting process)
- System. Csrebot for commandline
- 正向代理和反向代理快速理解
猜你喜欢
![[fundamentals of wireless communication-15]: illustrated mobile communication technology and application development-3-overview of digital communication 2G GSM, CDMA, 3G wdcma/cdma200/td-scdma, 4G LTE](/img/22/1efa444220131359b06005f597c9db.png)
[fundamentals of wireless communication-15]: illustrated mobile communication technology and application development-3-overview of digital communication 2G GSM, CDMA, 3G wdcma/cdma200/td-scdma, 4G LTE
![[fundamentals of wireless communication-14]: illustrated mobile communication technology and application development-2-the first generation mobile analog communication big brother](/img/fa/f9bad44147ba9af21183b7bd630e32.png)
[fundamentals of wireless communication-14]: illustrated mobile communication technology and application development-2-the first generation mobile analog communication big brother

How to maintain efficient collaboration in remote office and achieve stable growth of projects | community essay solicitation

FL Studio20.9水果软件高级中文版电音编曲

Necessary tools for testing - postman practical tutorial

Sun Yuchen told Swiss media Bilan that the bear market will not last long

LabVIEW计算相机图像传感器分辨率以及镜头焦距

【JS】【掘金】获取关注了里不在关注者里的人

Test essential tool - postman practical tutorial

Neo4j installation, operation, project construction and function realization
随机推荐
[Qt5 basic \u 1] starting from 0, Mr. Detian will study with you - Introduction to the window
go导入自建包
Factory + strategy mode
【agora】用户管理
When facing the industrial Internet, they even use the ways and methods of consuming the Internet to land and practice the industrial Internet
Handsontable数据网格组件
亲测有效,快速创建JMeter桌面快捷方式
Mathematical knowledge: 01 sequence satisfying conditions - find combinatorial number
Handsontable數據網格組件
MySQL insert \ pre update + judgment condition
Unknown database connection database error
机器学习9-通用逼近器径向基函数神经网络,在新观点下审视PDA和SVM
(翻译)实时内联验证更容易让用户犯错的原因
哪有什么未来可期,不过是打工人临死前最后的幻想罢了
数学知识:求组合数 III—求组合数
[fundamentals of wireless communication-15]: illustrated mobile communication technology and application development-3-overview of digital communication 2G GSM, CDMA, 3G wdcma/cdma200/td-scdma, 4G LTE
[queue] 933 Number of Recent Calls
PHP converts two-dimensional array elements into key value pairs
What other hot spots are hidden under 1500W playback? Station B 2 future trends you can't miss
AS400 大厂面试