Putting the keyword static in front of a local variable declaration creates a special
type of variable, a so-called static local variable. This variable keeps its value even
after the method ends. The next time you call this method, the variable isn’t
created anew but the existing one is used. You still can’t use the variable outside of
the method (it remains local) but it will stay alive once it has been created.