当前位置:网站首页>What is the difference between field, variable and property
What is the difference between field, variable and property
2022-07-29 04:21:00 【Deluxe big bowl tea】
It looks like a boring word game , But in fact Java There are descriptions of each item in the glossary .
Reference resources Java Glossary of terms
https://docs.oracle.com/javase/tutorial/information/glossary.html
field
- A data member of a class. Unless specified otherwise, a field is not static.
- Data members of a class . Unless otherwise specified , Otherwise, a field is not static .
property
- Characteristics of an object that users can set, such as the color of a window.
- Users can set the characteristics of objects , Such as the color of the window .
variable
- An item of data named by an identifier. Each variable has a type, such as int or Object, and a scope. See also class variable, instance variable, local variable.
- A data item named by an identifier . Each variable has a type , Such as int or Object, And a range . See class variable 、 Instance variables 、 local variable .
Actually variable not so bad , The other two are easy to confuse .
With Thread Class, for example , look down IntelliJ IDEA in , How does it distinguish field and property Of :
open Structure After the interface , The menu bar has two function buttons , Can be opened separately field and property:
field and property The front icons are respectively f or p Express . and property There is a small tip that can be opened , Click to find a series of methods or fields below this item . It's basically get、set These methods .
You can see that it is marked property Not all are user modifiable , such as #alive、#getThreads Are all #native Method , User settings are not supported .
and #getStackTrace It's going back to StackTraceElement Array .
Look again Thread Class UML Class diagram :
Many of them actually coincide .
however idea For reference only . But I also feel that this is unnecessary , The name depends on the context . But when reading official documents , I still have a concept about the difference between the two , At this time, the official description shall prevail .
边栏推荐
- Pix2.4.8 from start to installation (2021.4.4)
- C语言:typedef知识点总结
- Dabao and Erbao
- Fu Yingna: Yuan universe is the new generation of Internet!
- 不会就坚持68天吧 狒狒吃香蕉
- The third ACM program design competition of Wuhan University of Engineering
- 15.federation
- 不会就坚持64天吧 查找插入位置
- C language: summary of consortium knowledge points
- Exception resolution: error of not finding edu.stanford.nlp.semgraph.semgrex.semgrexpattern in cococaption package
猜你喜欢

信号处理中的反傅里叶变换(IFFT)原理

Machine vision Series 1: Visual Studio 2019 dynamic link library DLL establishment

从淘宝,天猫,1688,微店,京东,苏宁,淘特等其他平台一键复制商品到拼多多平台(批量上传宝贝详情接口教程)

Not for 60 days, magical dictionary

论pyscript使用感想(实现office预览)

不会就坚持65天吧 只出现一次的数字

Svg -- loading animation

Basic operation of queue

C language force buckle question 61 of the rotating list. Double ended queue and construction of circular linked list

Why are there so many unknowns when opengauss starts?
随机推荐
MPU6050
Model tuning, training model trick
Semantic segmentation correlation
How to execute insert into select from job in SQL client
Multi rotor six axis hardware selection
6. Pytest generates an allure Report
visio画网格
Won't you insist on 71 days? List sorting
恒星科通邀您“湘”约第24届中国高速公路信息化大会暨技术产品展示会
Beginner: array & String
不会就坚持62天吧 单词之和
Incubator course design (April 12, 2021)
Won't you just stick to 62 days? Sum of words
Do you have a boss to help me check whether the parameter configuration of the Flink SQL connection Kafka authentication Kerberos is wrong
[material delivery UAV] record (ROS + Px4 + yolov5 + esp8266 + steering gear)
Taobao product details interface (product details page data interface)
What the hell is this error? It doesn't affect the execution result, but it always reports errors when executing SQL... Connecting maxcomputer uses
Openfeign asynchronous call problem
不会就坚持71天吧 链表排序
Is there any way for Youxuan database to check the log volume that the primary cluster transmits to the standby cluster every day?

