...

/

Using an Enumeration with a for Statement

Using an Enumeration with a for Statement

In this lesson, we will look at a variation of the for statement known as a for-each statement and see how to use an enumerated data type with it.

We'll cover the following...

The for-each statement

Suppose that we define an enumeration such as

private enum Suit {CLUBS, DIAMONDS, HEARTS, SPADES}

If we want to repeat statements for each ...

Access this course and 1400+ top-rated courses and projects.