title: Trouble understanding instructions with simple Java program
body: <p>Before you dismiss this as another person asking for help with their homework, I don't actually want you to do anything other than helping me understand what the problem is asking. The instructions are to create an API for the program (that's just the main method) and to treat coincident as intersecting. I'm confused about why I would need to treat the lines as intersecting instead of overlapping, but anyways, here's the program and I'll tell you what I am having trouble with:</p>
  
  <pre><code>public class Rectangle {  
      private final double x; 
      private final double y;
      private final double width;
      private final double height;
      public Rectangle(double x0, double y0, double w, double h)
      {
      x = x0;   y = y0;
      width = w;
      height = h;
      }
      public double area()  
      { return width * height; }
      public double perimeter()
      { /* compute perimeter. */}
      public boolean intersects(Rectangle b) //this is what I don't get
      {/* does this rectangle intersect b? */}
      public void show(Rectangle b) //wouldn't it be better to draw any rectangle
      {   /* Draw the rectangle on StdDraw */  }
  </code></pre>
  
  <p>I'm pretty sure that Rectangle b is a rectangle, but wouldn't I have to create an object "Rectangle b" and obviously another rectangle in my main method that wouldn't affect that section of code where it checks if the rectangle intersect? Unless I'm just completely wrong and the objects' scopes extend beyond the main method. Also where I have to draw the rectangles, why does it look like it just wants me to draw one specific rectangle instead of creating a method that draws all rectangles I create? Thanks in advance.</p>