• Post Reply Bookmark Topic Watch Topic
  • New Topic

graphics paint  RSS feed

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which of the given options are true about the rectangle drawn by the following code ?
g.drawRect(30,30,200,200);
A. rectangle is a square
B. width=200 pixels
C. width=170 pixels
D. bottom right corner x=200,y=200
E. bottom right corner x=230,y=230
The answer given for this question was A,B,E. I think just A,B. I think the bottom right corner is x=230,y=30. Could somebody explain why E is also right.
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know how do u think the bottom right corner is x = 230 and y = 30.The last two arguments are width and height of the rectangle.As width = height = 200, it is square and the first two parameters are the upper left corner coordinates of the square.So the Bottom right corner has to (230,230).Hope it helps!!!
 
To do a great right, do a little wrong - shakepeare. twisted little ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!