This code will populate all array values with a given String using the Arrays.fill() command in the java.util.Arrays class.
In this case, all array values are filled with the String "Java Programming Forums"
A for-each loop at the end of the code prints the array values to the console.
import java.util.Arrays; public class PopulateArray { public static void main(String[] args) { // Declare String array called myArray String[] myArray = new String[10]; // Populate all array values Arrays.fill(myArray, "Java Programming Forums"); // for-each loop to print array values for (String a : myArray) { System.out.println(a); } } }