Question: Problem 3 (Arrays & Methods) Create a method that accepts an integer array and another integer value. The method will replace all instances of the

Problem 3 (Arrays & Methods) Create a method that accepts an integer array and another integer value. The method will replace all instances of the integer number in the array with zeros and returns the new array. Incorporate the method into a working program that tests the validity of your method. Your program will display the elements of a given array before the method is called and it will display the elements in the array again right after the method is invoked.

The methods header is specified as follows: public static int[] magicReplace(int[] theArray, int magicNumber)

Name your class as Q3ArrayReplace.java

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!