output is always three, im assuming this is because nameLength is being assigned to the last element of the array with consists of length 3.
package com.codegym.task.task07.task0703;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
/*
Lonely arrays interact
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader key = new BufferedReader(new InputStreamReader(System.in));
String [] array1 = new String[10]; // string array1
int [] array2 = new int[10]; //int array2
int nameLength=0; //initalized to 0 automatically
for(int i=0; i<array1.length; i++) {
array1[i] = key.readLine(); //fill String array with keyboard
nameLength = array1[i].length();
}
for(int j=0; j<array2.length; j++) {
array2[j] = nameLength;
}
System.out.print(Arrays.toString(array2));
}
}