Question: Write a method called fill that accepts an integer value as a parameter and replaces every value in the list with that value. For example,
Write a method called fill that accepts an integer value as a parameter and replaces every value in the list with that value. For example, if a variable called list initially stores [42, –7, 3, 0, 15] and the call of list.fill(2); is made, the list will be changed to store [2, 2, 2, 2, 2].
Step by Step Solution
3.49 Rating (156 Votes )
There are 3 Steps involved in it
public void fil... View full answer
Get step-by-step solutions from verified subject matter experts
