Replacing a Java array parameter

A Java program contains the following method and caller statements. Which statements correctly describe the arrays immediately before reset reaches its end? Select every correct statement.


Java
static void reset(int[] values) {
    values[1] = 8;
    values = new int[] {2, 3};
    values[0] = 7;
}

// In the caller:
int[] scores = {4, 5};
reset(scores);
Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Parameter Passing Questions: