I do not have much knowledge of Java, I would like to separate the strings from my List, with ",".
List<String> nomes = Arrays.asList("Paulo", "Ana", "Zeno", "Beno");
for(int i=0; i<nomes.size(); i++) {
System.out.format("%s%s", nomes.get(i),
i != nomes.size() - 1 ? ", " : " ");
}
But I did not find a good solution, I also tried with foreach
of Java 8, but I could not.