title: change value of variable in forEach loop java 8
body: <pre><code>int count =0;
  requestUserDto.getNodeIds().forEach(userNodeId-&gt;{
      count++; // this statement shows error
       // some another statements here
      }
  });
  </code></pre>
  
  <p>why <code>count++</code> shows error      </p>
  
  <p>Error: </p>
  
  <blockquote>
    <p>Local variable i defined in an enclosing scope must be final or effectively final</p>
  </blockquote>