private void restock() {

         

        

        Product product = product(readName());

        if (product == null){

            String name = readName();

             System.out.print("Adding new product");

            int stock = readNumber();

            double price = readPrice();

             products.add(new Product(name,stock,price));

            }

        else if (product != null){

           

           System.out.print("Restocking " + product.getName());

            int amount = readNumber();

            product.restock(amount);

        }

       


저기서 이름을 두번묻는데 두번째거 이름 묻는거 어떻게 스킵하면서 저기 new Product (name,stock,price) 

name 에 첫번째 물은거 넣을수잇음?          

        


요약하면 이름을 두번물음 한번만 묻게 하면서 저기 product 안에 이름을 어케 저장함?

참고로 read는 nextline 이런거임

        

        

            

      

    }