... 访问静态字段 static fields 只读的静态字段 Pascal RedValue ; Read-only Static 静态常量字段 static final ...
基于8个网页-相关网页
While static properties are often declared private to prevent meddling, there is one way of creating a read-only statically scoped property: You can declare a constant.
尽管静态属性通常被声明为private来防止别人干预,但有一种方法可以创建只读静态范围的属性,即声明常量。
Static fields that are neither constants nor read-only are not thread-safe.
不是常数也不是只读字段的静态字段不是线程安全的。
Because the compiler allocates constant strings in a static read-only memory, any attempts to modify it cause access violations and random crashes.
因为编译器在静态只读内存中分配常数字符串,所以,尝试修改该内存会导致访问冲突和随机崩溃。
应用推荐