Tag: Java keywords
What is Transient Keyword in Java? Transient modifier applicable only for variables but not for methods and classes. We can use a transient keyword in serialization context. At the time of serialization if we don’t want to save a value of a particular variable to meet security constraint then we . . . Read more
Summary table for Java access specifiers Visibility Private Default Protected Public Within the same class Yes Yes Yes Yes From child class of the same package No Yes Yes Yes From a non-child class of the same package No Yes Yes Yes From child class of outside package No No . . . Read more
What is Strictfp modifier in Java? Introduce in 1.2 version. We can declare Strictfp for classes and methods but not for variables. By using the strictfp keyword, we can ensure that floating point operations take place precisely. Usually, the result of floating point arithmetic is varied from platform to platform. . . . Read more
What is final in Java? Final is the modifiers applicable for classes, methods, and variables. The main advantage of final keyword is we can achieve security and we can provide the unique implementation. Final keyword improves performance. Not just JVM can cache final variable but also application can cache frequently use final . . . Read more