New course! Every coder should learn Generative AI!
Try a free lesson+ 8
Output is :
classname+hashCode
when you attempt to print object it envokes its default toString() method which gives that output.
You want to print each element of array so use a loop.
for(var s:myNames)
System.out.print(s+" ");
It's explained in course, so review it.
also you can use Arrays.toString()
System.out.println(java.util.Arrays.toString(myNames))