Enumaration (enum)


  • enum () is a key word.
  • It contains no. of integer constants which will be identified by named constants.
  • Syntax:
    enum enumName

    {

    enumeration list
    }

    E.g.: enum Color

    {
    Red,
    Green,
    Blue
    }
  • The members of an enumeration are accessed through their type-name and the dot operator.
    E.g.: Color.Red;
  • Enumeration improves code readability.
  • It also helps in avoiding typing mistake.

0 comments :

Post a Comment

> Related Posts with Thumbnails
 

Copyright © 2012. GS dot net - All Rights Reserved - Design by BTDesigner - Proudly powered by Blogger