In: Computer Science
45. Which statement correctly passes the array items to method takeArray? Array items contains 10 elements.
a. takeArray(items[9])
b. takeArray(items[])
c. takeArray(items)
d. Arrays cannot be passed to methods – each item must be sent to the method separately.
46. When an argument is passed by reference, ____________.
a. a copy of the argument’s value is passed to the called method
b. the original value is removed from memory
c. changes to the argument do not affect the original variable’s value in the caller
d. the called method can access the argument’s value in the caller directly and modify that data
47. Which of the following statements is false?
a. When an argument is passed by reference, the called method can access the argument’s value in the caller directly and can modify it.
b. To pass an object reference to a method, simply specify in the method call the name of the variable that refers to the object.
c. When an argument is passed by reference, the called method can access the argument’s value in the caller directly but cannot modify it.
d. To pass an individual array element to a method, use the indexed name of the array.
45.
Option c is correct.
46.
Option d is correct.
47.
Option c correct.
False:
When an argument is passed by reference, the called method can access the argument’s value in the caller directly but cannot modify it.
Reason: