I want to observe whether a variable's value has been changed. I was wondering if Java has something that is equivalent to the willSet
and didSet
methods in Swift ?
Not as a language. Java on its own does not really know properties of any kind. What you can do, though:
LongProperty
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.