Final answer:
To create the program, you can use nested loops to initialize the array with 1s and calculate the sum of each column.
Step-by-step explanation:
To create a Java program that creates a two-dimensional array of 10 rows and 10 columns, we can use nested loops. First, we initialize the array with all elements set to 1. Then, we iterate over each column, using a separate loop for each column. Inside the inner loop, we calculate the sum of the elements in that column.
int[][] array = new int[10][10];
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 10; j++) {
array[i][j] = 1;
}
}
for (int j = 0; j < 10; j++) {
int sum = 0;
for (int i = 0; i < 10; i++) {
sum += array[i][j];
}
System.out.println("Sum of column " + j + ": " + sum);
}