I just started learning Java and found that you have to set number of objects in an array before hand. so how can I make an array withou setting number of objects in an array like done in objective c.
I know I can do something like this
int a[] = {1,3,1,3,41,34}
but in this case you have to put all the objects at once is there a way to do that?
thanks
Arrays in Java are not resizeable. If you need that kind of capability, you should look into the
List<>interface, and the classes that implements it (includingArrayList<>,LinkedList<>, etc.)