import java.util.*;


public class WishList {
    public static void main(String arg[]){
        // create a ArrayList String type
        ArrayList<String> wishlist = new ArrayList<String>();
        Scanner input = new Scanner(System.in);

        do {
            System.out.println("Current list is " + wishlist);
            System.out.println("Add more? (y/n)");
            if (input.next().startsWith("y")) {
                System.out.println("Enter : ");
                Scanner user = new Scanner(System.in);
                wishlist.add(user.next());
            } else {
                break;
            }
        } while (true);
        input.close();
        System.out.println("List is " + wishlist);
        String[] arr = wishlist.toArray(new String[0]);
        System.out.println("Array is " + Arrays.toString(arr));

    }
}

WishList.main(null);
Current list is []
Add more? (y/n)
Enter : 
Current list is [shirt]
Add more? (y/n)
Enter : 
Current list is [shirt, pants]
Add more? (y/n)
Enter : 
Current list is [shirt, pants, jacket]
Add more? (y/n)
List is [shirt, pants, jacket]
Array is [shirt, pants, jacket]
import java.util.*;

public class WishList {
    public static void main(String arg[]){
        ArrayList<String> wishlist = new ArrayList<String>(){
            {
                add("pants");
                add("jeans");
                add("shirts");
                add("helmet");
                add("headphones");
            }
        }
        Scanner input = new Scanner(System.in);
        do {
            System.out.println("Current list is " + wishlist);
            System.out.println("Remove more? (y/n)");
         if (input.next().startsWith("y")) {
                System.out.println("Remove which value: ");
                Scanner user = new Scanner(System.in);
                for (int i = 0; i < wishlist.length(); i++){
                    if (wishlist(i) = user){
                        wishlist.remove(i);
                    }
                }
                
            } else {
                break;
            }
        } while (true); 

    }
}

WishList.main(null);
|                   add("pants");
cannot find symbol
  symbol:   method add(java.lang.String)

|                   add("jeans");
cannot find symbol
  symbol:   method add(java.lang.String)

|                   add("shirts");
cannot find symbol
  symbol:   method add(java.lang.String)

|                   add("helmet");
cannot find symbol
  symbol:   method add(java.lang.String)

|                   add("headphones");
cannot find symbol
  symbol:   method add(java.lang.String)

|                   for (int i = 0; i < wishlist.length(); i++){
cannot find symbol
  symbol:   method length()

|                       if (wishlist(i) = user){
cannot find symbol
  symbol:   method wishlist(int)