.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Sharon Maxwell

Post New Resource Bookmark and Share   

Enumeration in C#.net

Posted By:Narayanan       Posted Date: September 26, 2011    Points: 40    Category:    URL: http://www.dotnetspark.com  

Here ,we discussed about Create and use of Enumeration in C#.net


      It is a Symbols that have fixed values.

      List of choice for Developers using your class


Public   enum Gender






Public string Name;

Public int age;

Public Gender Gen;

Public person_Details (string _Name, int _age, Gender _Gen)


Name = _Name;

age =_age;

Gen =_Gen;



Public override string ToString ()


Return Name +  "("+ gender + "), age" + age ;  



Static void Main (string [] Arugs)


Person_Details persn = new Person_Details ("Narayanan", 28, Person_details.Gender.Male);

Console.WriteLine (persn.ToString);




Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend