I was going through head first
servlets &
jsp book on page no 295.
I came across this example, in which count is initialized in expression now count is incremented by one. Next time it comes in the loop, it again is assigned with zero. Since the variable declared in expression becomes local variable.
Now the same variable count is declared in declaration. So it becomes class variable. Now this variable count is accessed in the local method. Now the question is how can a variable be initialized at class level , unless its a static variable. The variable show in example is not declared as static (As its in a servlet which is derived from jsp page). So does a variable declared in declaration automatically become static ?
thanks