I am trying to get my string array to change into an int array based off the length of the names in the array.
String[] names = {"Sam", "Tommy", "Tim", "Sally", "Buck", "Bob"};
int[] nameLengths = {};
for (int i = 0; i < nameLengths.length - 1; i++) {
nameLengths[i] = names[i].length();
}
System.out.println(nameLengths);
the output is this.
[I@65b54208
I know I’ve dealt with this before but i can’t remember how I fixed it. Any help would be appreciated
haven’t messed with much since i remember it being kind of specific and I have no clue.
New contributor
GOS Playz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.