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.
换句话说,这意味着老的内存模型只保证正在读或写的变量的可见性,不保证写入其他变量的可见性。
On the subsequent remote logins to the system, the environment variable "TMOUT" will be set as read-only and with inactivity value as 60 seconds.
在后续的远程登录系统的过程中,环境变量“TMOUT ”将被设置为只读,并且不活跃值为60秒。
The old semantics of volatile only made promises about the visibility of the variable being read or written, and no promises about other variables.
volatile的旧语义只承诺正在读和写的变量的可见性,而不承诺其他的变量。
The up variable is declared as a read-only “value” using the val keyword.
变量up 被val关键字定义为一个只读的值。
Also, it can be seen that the value of the variable cannot be changed as we set it to read-only.
此外,可以看到,该变量的值不可改变,因为我们已将之设置为只读。
In a thread-safe program, only one writing thread can modify the variable; other threads can read the up-to-date value by declaring the variable volatile.
在一个线程安全的程序中,只有一个写线程能够修改这个变量;而其他的线程则可以读取volatile声明变量的最新值。
Scala allows you to decide whether a variable is immutable (read-only) or not (read-write) when you declare it.
当你声明一个变量的时候,Scala允许你来决定它是不变的(只读的)还是可变的(可读写的)。
Scala allows you to decide whether a variable is immutable (read-only) or not (read-write) when you declare it.
当你声明一个变量的时候,Scala允许你来决定它是不变的(只读的)还是可变的(可读写的)。
应用推荐