1.

Explain The Transient Field Modifier?

Answer»

When you declare a VARIABLE in a class TRANSIENT, you tell Java that the variable is not a part of the OBJECT's persistent state. Currently, Java does not use the transient keyword. However, future (persistent) versions of Java may use the transient keyword to tell the COMPILER that the program is using the variable for "scratch pad" purposes and that the compiler does not need to save the variable to disk. The following statement illustrates the use of the transient keyword:

transient float temp__swap__value;

When you declare a variable in a class transient, you tell Java that the variable is not a part of the object's persistent state. Currently, Java does not use the transient keyword. However, future (persistent) versions of Java may use the transient keyword to tell the compiler that the program is using the variable for "scratch pad" purposes and that the compiler does not need to save the variable to disk. The following statement illustrates the use of the transient keyword:

transient float temp__swap__value;



Discussion

No Comment Found