Olvídate de las matrices. No son un concepto para principiantes. Su tiempo se invierte mejor aprendiendo la API de Colecciones en su lugar.
/* Populate your collection. */
Set<String> colors = new LinkedHashSet<>();
colors.add("Red");
colors.add("Orange");
colors.add("Yellow");
...
/* Later, create a copy and modify it. */
Set<String> noRed = new TreeSet<>(colors);
noRed.remove("Red");
/* Alternatively, remove the first element that was inserted. */
List<String> shorter = new ArrayList<>(colors);
shorter.remove(0);
para inter-operar con las antiguas API basadas en matrices, hay un método útil en Collections
:
List<String> colors = new ArrayList<>();
String[] tmp = colorList.split(", ");
Collections.addAll(colors, tmp);
Gracias hombre! ¡Realmente me gusta! – Barakados