title: Java NullPointerException when calling from an abstract class
body: <p>I am trying to simply extend an abstract class in Java and call a few methods stored in it. I keep getting NullPointerException when I do so. Am I missing something about abstraction here?</p>
  
  <p>This is the parent class:</p>
  
  <pre><code>public abstract class Shape {
      public Color color;
      public Point center;
      public double rotation;
  
      public Shape() {
          Color color = new Color();
          Point center = new Point();
          rotation = 0.0;
          System.out.println("shape created");
      }
  
      public void setLocation( Point p ) { center.locationX = p.locationX; center.locationY = p.locationY; }
      public void setLocation( double x, double y ) { center.locationX = x; center.locationY = y; }
  
      public abstract double calcArea();
      public abstract boolean draw();
  }
  </code></pre>
  
  <p>And the child class:</p>
  
  <pre><code>public class Ellipse extends Shape {        
      public Ellipse() {
      }
  
      public double calcArea() {
          return 0.0;
      }
  
      public boolean draw() {
          return true;
      }
  }
  </code></pre>
  
  <p>You might want to see Point: </p>
  
  <pre><code>public class Point {
      public double locationX;
      public double locationY;
  
      public Point() {
          locationX = 0.0;
          locationY = 0.0;
      }
  }
  </code></pre>
  
  <p>And finally the main function:</p>
  
  <pre><code>public class MakeShapes {
      public static void main(String []args) {
          Ellipse myShapes = new Ellipse();
          myShapes.setLocation( 100.0, 100.0 );
      }
  }
  </code></pre>
  
  <p>As soon as I use the setLocation(), I get the NPE. Any thoughts? My brain hurts from trying to figure this out. Thanks!!!</p>