I need to figure out what this method does. I don't understand this part specifically. I also would like to know how to print the answer. What I have done just prints a memory address I think.
tmp[i] = a[i].length();
Here is the entire method
private static int[] bar(String []a)
{
int [] tmp = new int[a.length];
for (int i = 0; i<a.length;i++)
{
tmp[i] = a[i].length();
}
return tmp;
}
This is what I have tried to do to call the method and print the answer.
String [] a = {"hey", "how", "are", "you"};
System.out.println(bar(a));