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

Answer:

ArrayOps.findMax( ar2 )

New Picture

New Picture

 

 

The new picture shows the situation just after the second method call: ArrayOps.findMax( ar2 ); The parameter x of the method now refers to the second array.

By using parameters with methods you can use the same method with different data. This makes the method into a useful tool that can be used in many situations.

Note: In this picture, the arrow connected to ar2 and the arrow connected to x look quite different, although they point to the same object. However, when the program is running, the reference in x is identical to the reference in ar2. Both contain an identical reference to the array object.


QUESTION 8:

(Review: ) What are overloaded methods?


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