programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Sheriffs:
Saloon Keepers:
Bartenders:

# graphics paint

Ranch Hand
Posts: 45
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
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