Arrays in methods
Passing arrays in methods Outputs: 7 9 11 13 We pass our array james to the changearray method which adds 5 to each element.
Passing arrays in methods Outputs: 7 9 11 13 We pass our array james to the changearray method which adds 5 to each element.
So the above program creates a new scanner, then takes the input from the scanner and puts it in a string called 'name'. This string is then executed in the…