posted 23 years ago
Transient only applies to variables. The reason to make a variable transient is to not allow them to be part of thier persistent state. What that means is a transient variable will not be saved if you were to write the object out to a text file or something like that. The reason you may want to do this is for security reasons, salaries, credit card numbers, etc...
So, transient variables relate directly to Serializble class. There has been some confusion as to whether a transient variable can be static or not. A transient variable can be static, but since the only reason you use transient variable is to prevent them from being part of the persistent state, and static variables are not kept as part of the persistent state, doing so is redundant. If the variable is going to be static, you don't need to make it transient also. You can, but it doesn't have any effect.
Hope this helps some.
Bill