title: Static fields in JSP declaration
body: <pre><code>&lt;%!
  class father {
      static int s = 0;
  }
  %&gt;
  
  &lt;%
  father f1 = new father();
  father f2 = new father();
  f1.s++;
  out.println(f2.s); // It must print "1"
  %&gt;
  </code></pre>
  
  <p>When I run the file, I got this error. Can anybody explain?</p>
  
  <pre><code>The field s cannot be declared static; static fields can only be declared in static or top level types.
  </code></pre>