Please help me to conceptuallize meaning of following keywords with simple example :
- strictfp
- assert
- transient
- native
- synchronised
Please help me to conceptuallize meaning of following keywords with simple example :
See what a little google will get you. Question is, why didn't you google (bing, yahoo) it yourself?
http://en.wikipedia.org/wiki/List_of_Java_keywords
Although this page doesn't contain examples, each definition has a link to a much more detailed definition, and in some cases, resources that contain examples.
All the replies you want are in the Java Language Specification :
strictfp
: Floating point computation depends on the architecture of the processor. There will be slight differences in the number representation format in the processor, which will influence the error margin of the floating point operations. Early versions of Java were forcing a common representation in all implementations, irrespectively of the underlying CPU (x86, PPC, ...). This meant that the floating point operations had to be interpreted and couldn't be done as fast as the processor would have done. Later versions of Java (1.2 if I remember well) removed that constraint, to make direct use of the processor for faster result, at the expense of making the floating point results depend on the CPU architecture. Classes or method with scrictfp
will force the result to be independent of the CPU architecture.
assert
: to enforce assertions/"contracts".
native
: for JNI (linking to C libraries, for example).
transient
: for (non) serialization.
synchronized
: I can only recommend Java Concurrent in Practice.