0
I populated a list of dishes from a restaurant, after that, I added a function for the user to create a new dish when they want. However, in the method to create the new dish, I cannot add to the list that is in another class. The code is this:
File Processalists.java:
List<Prato> listaPratos = new ArrayList<>(); // preciso adicionar o novo objeto nessa lista através do método
    while (leitorPratos.hasNext()) {
        linhaPratos = leitorPratos.nextLine();
        String[] partesPrato = linhaPratos.split(";");
        Prato prato = new Prato();
        prato.setPrato(partesPrato[0]);
        prato.setPreco(Double.parseDouble(partesPrato[1]));
        prato.setCodigo(codigoPrato);
        listaPratos.add(prato);
        codigoPrato++;
    }
And this is the method created to add the object in the list above
File Processing Main.java
public static void criarNovoObjeto(int choice) throws FileNotFoundException {
    Scanner sc = new Scanner(System.in);
    String nomeProduto;
    double preco;
    int codigo;
    codigo = 18;
    System.out.println("Escolha a opção que deseja adicionar: ");
    System.out.println("1. Pratos ");
    System.out.println("2. Bebidas ");
    System.out.println("3. Vinhos ");
    if (choice == 1) {
        System.out.println("Digite o nome do seu prato: ");
        nomeProduto = sc.nextLine();
        sc.nextLine();
        System.out.println("Digite o preço do seu prato: ");
        preco = sc.nextDouble();
        sc.nextLine();
        Prato prato = new Prato();
        prato.setPrato(nomeProduto);
        prato.setPreco(preco);
        prato.setCodigo(codigo);
        //listaPratos.add(prato); // esse .add não funciona pois não encontra a lista
        
        ProcessaListas.lerArquivoPrato(
                "C:\\Users\\igorm\\Documents\\FACULDADE\\2semestre\\Desenvolvimento de Software l\\Atividade4\\pratos.csv");
    }
}
as I would to find the list of the file Processalists.java and add the value in it by creating method()?