• Post Reply Bookmark Topic Watch Topic
  • New Topic
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:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

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!!!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!