i\'ve digging around about the same issue but i couldn\'t find the same as i had
i want to create an array without declaring the size because i don\'t know how it w
As others have said, use ArrayList. Here's how:
ArrayList
public class t { private List x = new ArrayList(); public void add(int num) { this.x.add(num); } }
As you can see, your add method just calls the ArrayList's add method. This is only useful if your variable is private (which it is).
add