While writing the code today I needed to enumerate all the values of an enum. I am sure many of you know about this, but I did not and hence here it is. Suppose you have enum defined as follows and you want to enumerate all the possible values of Fruit.