Transient keyword is used by java programmers for variables, if the programmer does not want to store them permanently.
In case of serialization, the fields which are kept transient, are not the part of serialization process and not serialized.
Volatile is used along with the variable name, that can change its value without informing the JVM.
The system clock values are stored in Volatile variable.
They do not inform JVM when they change their value.
It ensures that the current value of the variable is read, rather than (perhaps) a cached version caused by some compiler optimization. From Wikipedia: "Generally speaking, the volatile keyword is intended to prevent the compiler from applying any optimizations on the code that assume values of variables cannot change "on their own.""
If you mark an instance variable as transient, you're telling the JVM to skip (ignore) this variable when you attempt to serialize the object containing it. Don't worry about Serialization just yet. That is a cool feature of java that we shall be seeing in greater detail in one of the subsequent chapters. For not it is enough to know that a transient variable will be ignored when the object is serialized.
Transient Variables
If you mark an instance variable as transient, you're telling the JVM to skip (ignore) this variable when you attempt to serialize the object containing it. Don't worry about Serialization just yet. That is a cool feature of java that we shall be seeing in greater detail in one of the subsequent chapters. For not it is enough to know that a transient variable will be ignored when the object is serialized.
Volatile Variables
The volatile modifier tells the JVM that a thread accessing the variable must always reconcile its own private copy of the variable with the master copy in memory. Did you understand that? Don't worry about it. For the exam, all you need to know about volatile is that, similar to the transient keyword, it can be applied only to instance variables. It is also important to note that using volatile keyword for variable in a class where you are implementing multi-threading is a bad bad idea.
No, 'check' is not a keyword in java language.
No extern keyword in Java.
There is no "foreign" keyword in Java, however, there is a native keyword that declares native methods in a native language, such as C or C++.For full list of keywords in Java see related question.
Literal in java are L, F, null, true, false These act as keyword(have special meaning in java) but these does'nt comes under the category of Java Keyword.
Java does not have multiple inheritance, so no. Java can use multiple interfaces, though, with the "implements" keyword.
Threads are not volatile. The volatile is a keyword that is used while having multiple threads in a Java Program. This keyword is used when multiple threads access a particular variable but still it is not mandatory to synchronize or prevent access to that variable.
No, 'check' is not a keyword in java language.
yes, float is keyword and data type in java
No extern keyword in Java.
"verify" is not a Java keyword. I believe the link, in related links, has the complete list of Java keywords.
we cannot use the staic keyword inside the method... But we can use the final keyword inside the method....
http://www.netrino.com/node/80 Good Article explaining, volatile keyword in detail. -- Pradeep Reddy
There is no "foreign" keyword in Java, however, there is a native keyword that declares native methods in a native language, such as C or C++.For full list of keywords in Java see related question.
Literal in java are L, F, null, true, false These act as keyword(have special meaning in java) but these does'nt comes under the category of Java Keyword.
"int" is the keyword for integer
Java does not have multiple inheritance, so no. Java can use multiple interfaces, though, with the "implements" keyword.
In Java, the final keyword specifies that the object created cannot be further redefined or derived.