12 Replies Latest reply: Jan 11, 2007 12:54 PM by 807599 RSS

    help with creating new constructor....beginners stuff

    807599
      im supposed to create a constructor that will draw a rectangle with the same dimensions as another rectangle.
      //Default constructor
          Rectangle()
          {        
          }
          
          Rectangle(double x, double y, double width, double height)
          {
              myX = x;
              myY = y;
              myWidth = width;
              myHeight = height;
          }
          
          Rectangle (Rectangle rectA)// heres the problem!
          {
              
                  }
      //and then later....
      
      Rectangle rectA =  = new Rectangle(0,0,200,50);
      
      and 
      
      Rectangle rectB = new Rectangle (rectA);
      i'm not sure if this is where my definite problem lies, seeing that my new rectangle isn't constucted where i need it to be; i can't move rectB without ruining my other rectA's...