title: Java: possible wrong abstract class impletaion
body: <p>I chose this title because I noticed that I did something wrong with the implantation of abstract class but I'm not quite sure what yet. </p>
  
  <p>I created the MoveAble abstract class for training purposes and created the Ball class from it. Also I created a GetPosition() method only for the moveAble class and use it from the ball class.
  But when I called GetPosition() on any ball object, i got the position varibale of the Moveable Abstract object instead.</p>
  
  <p>I'm guessing its suppose to be that way, but from my understanding we can't use abstract class anyway, so I need to be able to get the position value of the child class even if I implemented this method only on the parents class.</p>
  
  <p>Note: I'm a beginner java programmer. there is probably a better way to do what I did, but that's what I came out with. I would like to hear what you guys think about it, A if you think it's all crooked and there is a better way for all of this I will be glad to learn it.</p>
  
  <p>Moveable class:</p>
  
  <pre><code>public abstract class MoveAble {
      private int[] position = new int[2];
      private int[] velocity = { 1, 1 };
  
      public int[] getPosition() {
      return position;
      }
      public abstract void move(int width, int height) ;
  </code></pre>
  
  <p>The ball class:</p>
  
  <pre><code>public class Ball extends MoveAble{
  
      private int[] position = new int[2];
      private int[] velocity = { 1, 1 };
  
      public Ball(int x_position, int y_position) {
  
          position[0] = x_position;
          position[1] = y_position;
      }
  
      @Override
      public void move(int width, int height) {
          if (position[0] &gt;  width - 30 || position[0] &lt;  1) {
              velocity[0] *= -1;
          }
          if (position[1] &gt; height - 30 || position[1] &lt;  1) {
              velocity[1] *= -1;
          }
          position[0] += velocity[0];
          position[1] += velocity[1];
  
      }
  </code></pre>