1. What is static keyword in Java? Static is a Non-Access Modifier. Static can be applied to variable, method, nested class and initialization blocks (static block). 2. What is a static variable? A Static variable gets memory allocated only once during the time of class loading. All the instance of the class share the same copy of the variable, a static variable can … [Read more...]
Java Static Import
The static import is a new feature which is added in Java 5 through which we can access any static member of a class directly. There is no need to qualify it by the class name. For example we can use "System.out.println()" directly with out prefixing System class like "out.println" (As out is a static member of System class). … [Read more...]