Customer is a class that has a method getName() and a constructor that takes the name as an argument. You have an array of Customer objects, defined like this:
Customer[] customers = {
new Customer("a"),
new Customer("b"),
new Customer("c")
};
Which code snippet can be used to print the name of all customers in the customers array? Choose the correct answer:
A. for (Customer c in customers) {
System.out.println(c.getName());
}
B. for each (Customer c in customers) {
System.out.println(c.getName());
}
C. for (Customer c : customers) {
System.out.println(c.getName());
}
D. for each (Customer c : customers) {
System.out.println(c.getName());
}