variables and methods and actionlisteners
<p>I have this (partially pseudo)code</p>

<pre><code>class a {
  void b()
  {
    int d = 0;
    JButton c = new JButton();
    c.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e)
      {
        d = 1;
      }
    });
  }
}
</code></pre>

<p>However, it doesn't work, eclipse suggested adding final identifier to d, but that makes value impossible to change. Sorry if it's a stupid question, but it's hard to form a question for Google for something like this...
I also can't declare variable on lever higher than method b.</p>
