Tutorial by Examples

final in Java can refer to variables, methods and classes. There are three simple rules: final variable cannot be reassigned final method cannot be overriden final class cannot be extended Usages Good Programming Practice Some developer consider it good practice to mark a variable final wh...
The volatile modifier is used in multi threaded programming. If you declare a field as volatile it is a signal to threads that they must read the most recent value, not a locally cached one. Furthermore, volatile reads and writes are guaranteed to be atomic (access to a non-volatile long or double i...
The static keyword is used on a class, method, or field to make them work independently of any instance of the class. Static fields are common to all instances of a class. They do not need an instance to access them. Static methods can be run without an instance of the class they are in. However...
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. abstract class Car { abstract void tagLine(); } ...
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...
A variable which is declared as transient will not be serialized during object serialization. public transient int limit = 55; // will not persist public int b; // will persist
Java SE 1.2 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), ov...

Page 1 of 1