Here you are shadowing the static variable. ie the incremented a variable in the method modi is actually the local variable a that is declared in the method.
and when you call the println in the main method the actual static variable initialised to 0 is printed.
This behavior has nothing to do with the variable being static (and nothing to do with the increment operator). Instead, it's because method arguments are assigned to variables that are local to the method. In this case, the local variable happens to have the same name ('a') as the class variable -- but these are different variables.
Try this modified version...
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org