I have created the below arrayLIST . I want to modify the phone number of [email protected]. Can you please let me know how to modify it. Thanks in advance
private static List<Customer> customers;
{
customers = new ArrayList();
customers.add(new Customer(101, "John", "Doe", "[email protected]", "121-232-3435"));
customers.add(new Customer(201, "Russ", "Smith", "[email protected]", "343-545-2345"));
customers.add(new Customer(301, "Kate", "Williams", "[email protected]", "876-237-2987"));
}
customers.get(0).setPhoneNumber("xxx-xxx-xxxx");assumingCustomerclass has getters and setters.