Llocalvariable a ocal variable a number does not

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: e 20 11/2/2008 Passing Arrays to Methods - 1 Code A A minOne = searchMinimum(arrayOne); public int searchMinimum(float number)) { … } At A before searchMinimum A arrayOne A. LLocalvariable A. ocal variable A. number does not number does not exist before the exist before the method execution method execution State of Memory Page 21 11/2/2008 Passing Arrays to Methods - 2 Code minOne = searchMinimum(arrayOne); public int searchMinimum(float number)) { B B … } The address is copied at B B arrayOne number B. The value of the B. The value of the B. argument, which is argument, which is an address, is copied an address, is copied to the parameter. to the parameter. State of Memory Page 22 11/2/2008 Passing Arrays to Methods - 3 Code minOne = searchMinimum(arrayOne); public int searchMinimum(float number)) { … C C } While at C inside the method C arrayOne number C. The array is C. The array is C. accessed via accessed via number inside number inside the method. the method. State of Memory Page 23 11/2/2008 Passing Arrays to Methods - 4 Code minOne = searchMinimum(arrayOne); public int searchMinimum(float number)) { … D D } At D after searchMinimum D arrayOne number D. The parameter is D. The parameter is D. erased. The argument erased. The argument still points to the same still points to the same object. object. State of Memory Page 24 11/2/2008...
View Full Document

This document was uploaded on 03/03/2014.

Ask a homework question - tutors are online