title: Unable to understand firstTerm = secondTerm; secondTerm = nextTerm; in fibonacci series
body: <pre class="lang-java prettyprint-override"><code>class Main {
    public static void main(String[] args) {
  
      int n = 5, firstTerm = 0, secondTerm = 1;
      System.out.println(&quot;Fibonacci Series till &quot; + n + &quot; terms:&quot;);
      
  
      for (int i = 1; i &lt;= n; ++i) {
        System.out.print(firstTerm + &quot; &quot;);
  
        // compute the next term
        int nextTerm = firstTerm + secondTerm;
           firstTerm = secondTerm;
           secondTerm = nextTerm;
      
      }
    }
  }
  </code></pre>
  <p>//Q) Unable to understand why firstTerm = secondTerm;
  secondTerm = nextTerm; statement is written, can anyone explain me this concept</p>