go to previous page   go to home page   go to next page

What is the location of pointA after the following:

pointA.move( 24-12, 30*3 + 5 );

Answer:

pointA will now be located at x = 12, y = 95.


Step-by-Step Method Call

You probably did the right thing to get the answer, but let us go through it again, just to be sure:

pointA.move( 24-12, 30*3 + 5 );

is equivalent to:

pointA.move( 12, 30*3 + 5 );

is equivalent to:

pointA.move( 12, 90 + 5 );

is equivalent to:

pointA.move( 12, 95 );

The move() method starts running with the two int values it requires.

The expressions in the parameter list are evaluated before the method starts running. The resulting values should be the data type expected by the method, or a data type that can be converted to that type.


QUESTION 4:

What do you suspect will happen with the following method call?

pointA.move( 14.305, 34.9 );

go to previous page   go to home page   go to next page