This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi Tom, Transient comes into play regarding serialization. A transient variable will not be serialized. This is important, because some class state variables don't need to be persistent. For example, suppose you had the following class:
The currentTemperature will probably be different when the class is restored. Therefore, we don't want to waste file space saving a variable that will change anyway. Volatile relates to threading and optimization. When you declare a variable to be volatile, you are telling the compiler not to try and optimize (sharing) it regarding threading. I don't really have an example for this because I have not used it. Regards, Manfred.
Strictfp is just like volatile -- you'll probably never actually need to use it. Actually you're more likely to use volatile. It just means that arithmatic will be done exactly according to some standard or other (a standard that has also been implemented in other languages like C++). With strictfp, the answer to 345/235.63 will always be exactly the same no matter what vitual machine and operating system you calculate it on. Without strictfp, there's an allowed margin of error. It's sort of the counterpart to the java.lang.StrictMath. Just another feature that will never be used.