How does one println print out the whole array list? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

How does one println print out the whole array list?

I was surprised to see the whole arraylist printed out with a single println statement. I would have thought a loop would be necessary. Is this because of a toString method that's part the arraylist class?

29th Jan 2017, 1:02 PM
John Myers
John Myers - avatar
1 Resposta
0
But you have that output [1, 2, 3, 4]. How about if you want a single element or print it on a separate lines or without a paranthesses (here you can use substring).
2nd Feb 2017, 5:59 AM
Š˜Š²Š°Š½ Š˜Š²Š°Š½Š¾Š²
Š˜Š²Š°Š½ Š˜Š²Š°Š½Š¾Š² - avatar