- 论坛徽章:
- 0
|
Transient: The transient modifier applies to variables only and it is not stored as part of its object's Persistent state. These variables are not serialized. Transient instance fields are neither saved nor restored by the standard serialization . You have to handle restoring them yourself.Volatile: Volatile modifier tells the compiler that the variable modified by volatile can be changed unexpectedly by other parts of the program. For example a Variable might be read from Cache and not update the content if it has been changed by another thread. Specifying a variable as volatile tells the JVM that any threads using that variable are not allowed to cache that value at all. Making the Variable Volatile will ensure that the compiler will get the content of the variable every time it is used and not cache its content. If not used Carefully this modifier might introduce bugs..Strictfp : is used to restrict floating point calculations ( fp ) to ensure portability (platform Independent ). When this modifier is specified, the JVM adheres to the Java specifications ( IEEE-754 floating-point specification ) and returns the consistent value independent of the platform. That is, if you want the answers from your code (which uses floating point values) to be consistent in all platforms, then you need to specify the strictfp modifier.
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/24003/showart_209792.html |
|