title: Getting value from an abstract class
body: <p>So I'm trying to get value of Speed from class Players and transfer it to variable newSpeed in Class Player1.However Iam still unable make Speed from Players pass the value to newSpeed of class Player1. The value of newspeed should have been 2 but it stil remains as 0. I have been stuck at it for more than 2 hours. I really need help.</p>
  
  <p>P/S: I did not include my Driver class because i belive the problem lies somewhere here. However i can still include them here if u need it</p>
  
  <p>Class Players: </p>
  
  <pre><code>    public abstract class Players {
  
  
     protected static int speed=2;
     private int x;
     private int y;
     public abstract void resetLocation();
  
     public int getSpeed()
     {
        return speed;
     }
  }
  </code></pre>
  
  <p>Class Player 2</p>
  
  <pre><code>public class Player2 extends Players {
  
      private int newSpeed=1;
  
      Player2() {
  
          super.speed=this.newSpeed;
      }
  
  
      public int getSpeed()
      {
          return newSpeed;
      }
      /**
       *
       * Function to set how many steps can the player goes.
       */
      public void setMovementSpeed(int speed)
      {
          this.newSpeed=speed; //this is for another functionality.
      }
  
  }
  </code></pre>
  
  <p>Main :</p>
  
  <pre><code>public class Main {
      public static void main(String[] args)
      {
  
          Player2 p2 = new Player2();
  
  
          System.out.println(p2.getSpeed());
      }
  }
  </code></pre>
  
  <p>This is what i have tried.</p>