title: Java - Error when creating Rectangle2D object
body: <p>I am using Shapes to check for collisions in my game. I am using the intersect method for that. But strangely getting an Error when defining on of the shapes. Eclipse is telling me that this is incorrect.</p>
  
  <p>This works:</p>
  
  <pre><code>// Collision Shape
  protected RectangularShape col;
  
  col = new Ellipse2D.Double(x, y, ObjectSpriteManager.SIZE, ObjectSpriteManager.SIZE);
  </code></pre>
  
  <p>But this does not:</p>
  
  <pre><code>// Collision Shape
  protected RectangularShape col;
  
  col = new Rectangle2D.Double(x, y, ObjectSpriteManager.SIZE, ObjectSpriteManager.SIZE);
  </code></pre>
  
  <p>What confuses me is that both are Subclasses of RectangularShape</p>
  
  <p><a href="https://docs.oracle.com/javase/7/docs/api/java/awt/geom/RectangularShape.html" rel="nofollow noreferrer">https://docs.oracle.com/javase/7/docs/api/java/awt/geom/RectangularShape.html</a></p>
  
  <p>I am really no expert in Java so I am probably overseeing something with. Maybe some of you could help me :)</p>
  
  <p>/EDIT:
  Here is a screenshot of the problem in Eclipse:
  <img src="https://i.stack.imgur.com/G8Hm4.png" alt="enter image description here"></p>
  
  <p>/EDIT_2: I found the error thanks to David ten Hove. I imported the wrong Rectangle2D.</p>