Use the method Arrays.fill(<array>,<value>);
`
Following an example.
import java.util.* int[] myArray = new int[4]; Arrays.fill(myArray, -1);
The result of this example will be [-1,-1,-1,-1];
Solutions for developers
Use the method Arrays.fill(<array>,<value>);
`
Following an example.
import java.util.* int[] myArray = new int[4]; Arrays.fill(myArray, -1);
The result of this example will be [-1,-1,-1,-1];