...来源于 constant 这个词,但是用 Const 类型定义的变量,其实依然是 变量(variable) ,最多称为只读变量(read-only variable) ,而不是常量(constant) 。变量存 放在栈或者堆中,而堆栈里的内容,理论上都是可以改变的。
基于20个网页-相关网页
The first line USES the val keyword to declare a read-only variable named book.
在第一行我们使用了val关键字来声明一个只读变量book。
In other words, this means that the old memory model made promises only about the visibility of the variable being read or written, and no promises about the visibility of writes to other variables.
换句话说,这意味着老的内存模型只保证正在读或写的变量的可见性,不保证写入其他变量的可见性。
应用推荐