+ 1
What is wrong with this code? It shows me a message [Ljava.lang.String;@15db9742
package aRirays; public class Program { public static void main(String[] args) { String names = " Pet, Lee, Tom, Edo"; String[] splitNames= names.split(", "); System.out.println(splitNames); } }
2 Antworten
+ 3
The way you want to print the array was wrong.
Thats How it works ;)
import java.util.Arrays;
public class Program
{
public static void main(String[] args) {
String names = " Pet, Lee, Tom, Edo";
String[] splitNames = names.split(", ");
System.out.println(Arrays.toString(splitNames));
}
}
+ 2
Thank you for your quick response