-2

Here is my basic setup:

ArrayList<String> myList = new ArrayList<>();
myList.add("test");
String[] arr = myList.toArray(new String[myList.size()]);
System.out.println(arr);

And i get the classic error: [Ljava.lang.String;@1540e19d

Can anyone explain and help me fix it?

1 Answers1

0

Use

for(String s : arr){
    System.out.println(s);
}

Instead of System.print.out();

wdc
  • 2,623
  • 1
  • 28
  • 41