Beware that if your static java.lang.NoClassDefFoundError when you try to access the class which failed to load.block throws Exception than you may get
This shows that static method can not be overridden in Java and concept of method overloading doesn't apply to static methods. Instead declaring same static method on Child class is known as method hiding in Java.
Best practices - static variable and static method in Java
Here are some of the best practices you can follow while using static variable and method in Java.
1. Consider making a static variable final in Java to make it constant and avoid changing it from anywhere in the code. Also remember that if you change value of static final variable in Java like in enum String pattern, you need to recompile all classes which use those variable, because static final variables are cached on client side.
That's all on What is static variable, method and nested static class in Java. knowledge of static keyword in Java is must for any Java programmer and skill to find out when to use static variable or static method is an important skill. Incorrect and careless use of static variable and static method in Java will result in serious concurrency issues like deadlock and race condition in Java.