Write a for-each loop that prints all elements in a collection of Student objects called role. What is required for that loop to work?

What will be an ideal response?

```
for (Student pupil : role)
System.out.println(pupil);

```

Computer Science & Information Technology

You might also like to view...

The C++ ________ operator represents logical AND.

A) ++ B) .AND. C) || D) & E) &&

Computer Science & Information Technology

In the accompanying figure, the item marked 2 represents the ____.

A. margin B. border C. content D. padding

Computer Science & Information Technology