| Start |
|---|
| final
Usages Good Programming Practice Some developer consider it good practice to mark a variable final when you can. If you have a variable that should not be changed, you should mark it final. An important use of This emphasizes that the Inner class Access If your anonymous inner class wants to access a variable, the variable should be marked This class doesn't compile, as the variable Effectively final variables are an exception. These are local variables that are written to only once and could therefore be made final. Effectively final variables can be accessed from anonymus classes too.
Even though the code below is completely legal when The reason is, let's repeat again, final variable cannot be reassigned. Since or by using a static initializer:
All wrapper classes in Java are final, such as |
| static The
|
| abstract Abstraction is a process of hiding the implementation details and showing only functionality to the user. An abstract class can never be instantiated. If a class is declared as abstract then the sole purpose is for the class to be extended. |
| strictfp strictfp modifier is used for floating-point calculations. This modifier makes floating point variable more consistent across multiple platforms and ensure all the floating point calculations are done according to IEEE 754 standards to avoid errors of calculation (round-off errors), overflows and underflows on both 32bit and 64bit architecture. This cannot be applied on abstract methods, variables or constructors. |
| volatile The |
| synchronized Synchronized modifier is used to control the access of a particular method or a block by multiple threads. Only one thread can enter into a method or a block which is declared as synchronized. synchronized keyword works on intrinsic lock of an object, in case of a synchronized method current objects lock and static method uses class object. Any thread trying to execute a synchronized block must acquire the object lock first. |
| transient A variable which is declared as transient will not be serialized during object serialization. |
Read Article
https://develop.horje.com/learn/1434/reference