216k views
2 votes
How do the arguments for the drawLine() method compare to the arguments for drawOval or drawRect()?

A
In all three cases the first two arguments define the top-left point in the figure, and the last two arguments define the bottom-right point.

B
In all three cases the first two arguments define a starting point, and the last two arguments define a width and length for the figure.

C
In all three cases the first two arguments define a starting point for the figure. For drawLine(), the last two arguments define the line's other endpoint, while for drawOval() and drawRect() they define the shape's width and height.

D
The drawLine() method uses a point, angle, and length for arguments, while drawOval() and drawRect() use a point, a width, and a height.

User Praween K
by
6.3k points

1 Answer

3 votes

Answer:

The answer is option C "In all three cases the first two arguments define a starting point for the figure. For drawLine(), the last two arguments define the line's other endpoint, while for drawOval() and drawRect() they define the shape's width and height"

Step-by-step explanation:

All the three methods are used to draw shapes and below is how arguments are passed in each method:

1. drawLine( int x1, int y1, int x2, int y2)

Draws a line, between the points (x1, y1) and (x2, y2)

2. drawRect( int x, int y, int width, int height)

Draws the outline of a rectangle of the specified width and height whose top left corner is at position (x,y).

3. drawOval( int x, int y, int width, int height)

Draws the outline of an oval. The result is a circle or ellipse that fits within the rectangle specified by the x, y, width and height arguments

User Nischal Hada
by
5.2k points