Why is the route I'm taking while tracing the code wrong?
<p>I am supposed to be tracing this code for my class but no matter how many times I go through it I seem to get the wrong answer.</p>

<p>The code below has me trace it and find the output. The route I take is as soon as I hit one(tweets) I jump straight to it before continuing to the for loop after it. </p>

<p>I get the answer</p>

<blockquote>
  <p>Index0:a is -4 b is 1</p>
  
  <p>Index0:a is 14 b is -5</p>
  
  <p>Index0:a is 16 b is 1</p>
  
  <p>c is 6</p>
</blockquote>

<pre><code>public class Tweet
{
   private int a;
   private int b;
   public static int c = 0;

   public Tweet(int a, int b)
   {
      this.a = a;
      this.b = b;
      c += this.a + this.b;
   }

   public int getA()
   {
      return this.a;
   }

   public int getB()
   {
      return this.b;
   }

   public void setA(int a)
   {
      this.a = a;
   }

   public void setB(int b)
   {
      this.b = b;
   }
}

public class Homework4
{
   public static void main(String[] args)
   {
      Tweet t1 = new Tweet(3, 8);
      Tweet t2 = new Tweet(-3, 7);
      Tweet[] tweets = { t1, t2, new Tweet(0, -5) };
      one(tweets);
      for (int i = 0; i &lt; tweets.length; i++)
      {
         System.out.print("Index 0: ");
         System.out.print("a is " + tweets[i].getA());
         System.out.println(" b is " + tweets[i].getB());
      }
      System.out.println("c is " + Tweet.c);
   }
   public static void one(Tweet[] tws)
   {
      for (int i = 0; i &lt; tws.length - 1; i++)
      {
         Tweet w = tws[i];
         Tweet x = tws[i + 1];
         w.setA(2 * x.getB());
         w.setB(-2 + x.getA());
      }
      tws[2] = tws[0];
      tws[0].setA(-4);
   }
}
</code></pre>

<p>This is my first time posting on here so if more info is needed let me know, I just need to know what I'm doing wrong here.</p>