Chapter 6: Controlling Program Flow with Loops 141 (Web hosting domains)
Chapter 6: Controlling Program Flow with Loops 141 You can apply values()to the name of any enumtype. In fact, to create a n enhanced forloop with an enumtype, you have to use something like values(). The expression Suspect.values()stands for all the items you list in the declaration of the Suspectenumtype. So, in the loop of Listing 6-5, mySuspectbecomes mustard, then plum, then green, and so on. When you apply values()to the name of an enumtype, you get an array of items belonging to that enumtype. To read all about arrays, see Chapter 11.
We provide special commissions and earns up to $125 us per referral for all website hosting directories. With such big commissions you should immediately sign up for our affiliate program for website hosting directory sites.