What does the static keyword mean in Java when it is applied to a variable, a method, a nested class and an initializer block?
Static means belongs to the class rather than to an instance. Everything declared static has exactly one copy per class, shared by every instance and reachable without creating an object.
A static field is a class-level variable. It is created when the class is initialised and lives until the class is unloaded, so it is the natural place for counters, configuration, caches and constants. A static method is a class-level operation with no this reference, which means it cannot touch instance state directly. A static nested class is a class defined inside another class, held by the outer class rather than by an instance; it can still be instantiated on its own, but it does not get an implicit reference to an enclosing instance the way a non-static inner class does. A static initializer block runs once, when the class is initialised, and is the traditional place for expensive one-time setup.
Two rules make the design consequences concrete. A static method cannot reference an instance field or call an instance method of the same class, because there is no instance to read them from. And a static method can be called without an object, which means it cannot be overridden polymorphically — a subclass method with the same signature hides it instead.
The classic smell is a static method that reaches for global state. Once a class has static mutable fields, two threads can corrupt each other's state, and the class becomes untestable without resetting that state between cases. Static constants are fine; static mutable state is usually a design smell.