Reading strings and saving them in arrays

I’m trying to make a program (in java) where a costumer puts names and it reads the names and has to save all the names in an array. But my biggest problem is that I don’t know the amount of names that the costumer will put. For that same reason I tried do the following:

public static void main(String[] args) {     Scanner ler = new Scanner(;     String seller = "";     int x = 0;     String[] arr = new String[x];     while (!seller.equals("end")){     System.out.print("Seller: ");     seller =;        for(int indice = 0; indice < arr.length; indice++){     arr[indice] =;     System.out.print(arr[indice]);      }    } 


I’m new in java. Can you help me? Thank you very much!