当前位置:网站首页>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 .
边栏推荐
- How to query the submission number of a version
- It won't last for 65 days. It only appears once
- 15.federation
- The function "postgis_version" cannot be found when installing PostGIS
- How to set the SQL execution timeout for flick SQL
- How to execute insert into select from job in SQL client
- Jenkins 参数化构建中 各参数介绍与示例
- BIO、NIO、AIO的区别和原理
- Differences and principles of bio, NiO and AIO
- 不会就坚持66天吧 权重生成随机数
猜你喜欢

Beginner: array & String

不会就坚持60天吧 神奇的字典

12.优先级队列和惰性队列

10. Fallback message

RMAN do not mark expired backups

6. Pytest generates an allure Report

It won't last for 65 days. It only appears once

String, array, generalized table (detailed)

Introduction and examples of parameters in Jenkins parametric construction

Not for 63 days. The biggest XOR
随机推荐
C语言:浅谈各种复杂的声明
[paper translation] vectornet: encoding HD maps and agent dynamics from vectorized representation
Cad2020 introductory learning (2021.4.13)
6. Pytest generates an allure Report
Shielding ODBC load balancing mode in gbase 8A special scenarios?
Locally call tensorboard and Jupiter notebook on the server (using mobaxterm)
9. Delay queue
Copy products with one click from Taobao, tmall, 1688, wechat, jd.com, Suning, taote and other platforms to pinduoduo platform (batch upload baby details Interface tutorial)
Database SQL statement realizes function query of data decomposition
How to write the filter conditions of data integration and what syntax to use? SQL syntax processing bizdate can not be
What is the use of meta-info?
Object detection: object_ Detection API +ssd target detection model
不会就坚持66天吧 权重生成随机数
[hands on deep learning] environment configuration (detailed records, starting from the installation of VMware virtual machine)
异常处理:pyemd或PyEMD找不到
Not 67 days, square root
C language: talking about various complex statements
不会就坚持60天吧 神奇的字典
RMAN do not mark expired backups
11.备份交换机

