Java is allow to create static inner class.
A static nested class interacts with the instance members of its outer class (and other classes) just like any other top-level class. In effect, a static nested class is behaviorally a top-level class that has been nested in another top-level class for packaging convenience.
You can access static nested classes are accessed using the enclosing class name: like
StringMatrix.moves
Why do we need static nested class?
static nested classes aren't really needed. However, you could make the argument that if two classes are only used together -- such as class A uses helper class B, and B is never used independently -- then a static nested class is the way to go. In other words, by making B just a regular old class, the programmer who stumbles across it may try to use it. If B were a static nested class, then it's more clear that it has a special use that relates to A.