title: Does Global variable use more memory than local variables?
body: <p>In my code SonarLint suggests me to use local variables, but I want to understand if it's really the best practice to save memory.</p>
  <p>Let's say I have the following class :</p>
  <pre><code>public class BufferedService {
     private BufferedImage firstImage;
     
     public void methodToUseVariable() {
        firstImage = ImageIO.read(new File());
     }
  }
  </code></pre>
  <ol>
  <li><p>What Sonar Lint is suggesting is</p>
  <pre><code>public class BufferedService {
  
  public void methodToUseVariable() {
     final BufferedImage firstImage = ImageIO.read(new File());
     // Something to do with firstImage...
  }
  </code></pre>
  <p>}</p>
  </li>
  </ol>