dimanche 22 juin 2014

add elements to Java Array


Vote count:

0




Let's say we defined an array with 20 elements. is there any way we can add some objects to the array, without any specific order of course and not just once like String[] t= {"one", "two", ..., "twenty"} ?



String[] t = new String[20];
//I know this won't work
//but something like this:
//t = {"one", "two", "three"}
//and later, add some more
//t = {"four"} ...


asked 1 min ago






Aucun commentaire:

Enregistrer un commentaire