When you pass an array to a method, the method receives ______.
1. the length of the array
2. a copy of the reference to the first element
3. a copy of the reference to the array
4. a copy of the first element
5 .a copy of the array

Respuesta :

The correct option is 3.
When an array is passed as a parameter to a function, it is usually passed as a reference parameter. What is actually passed is the address of its first element. Since arrays are typically passed by reference, it means that if the function changes the value of an element in an array, then the corresponding actual array will change that element. To declare an array of real values as parameter one has to specify the parameters.