you can do it with printf
Java
printf( )
System.out.printf( “format-string” [,arg1, arg2, ... ] ); //%s for string. %d for decimal integer, %c for character.
System.out.printf("%s\n%s",myNames[1], myNames[2]);
or with println
System.out.println(myNames[1] + "\n" + myNames[2]);
for more information you can check this site. https://www.cs.colostate.edu/~cs160/.Spring16/resources/Java_printf_method_quick_reference.pdf
1
solved printing multiple results using, System.out.println