PDA

View Full Version : Java help



Java
02-05-2002, 05:45 PM
Hello,

How would I write a program which prints out two rectangles and the rectangle created by the intersection of the original two?

Thank You For Your Help

CompiledMonkey
02-05-2002, 05:54 PM
Maybe by using code? :p

mithrandir
02-05-2002, 05:55 PM
Try here for a Java board - http://forum.java.sun.com/

mithrandir
02-05-2002, 05:56 PM
And don't worry about Chris...he's just Chris (he can't help it).

CompiledMonkey
02-05-2002, 10:01 PM
Man, take a joke. :rolleyes:

mithrandir
02-05-2002, 10:40 PM
Why don't you.

taylorguitarman
02-06-2002, 03:58 AM
Here's the idea-



Rectangle Rect1 = new Rectangle(0, 0, 50, 25);
Rectangle Rect2 = new Rectangle(10, 10, 50, 25);
Rectangle RectIntersect = Rect1.intersection(Rect2);


Then output the rectangles however you want.