Enumeration in C#.net

Posted by Naraayanan under C# category on | Points: 40 | Views : 1994
? 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);

Comments or Responses

Posted by: Suma on: 2/22/2012 Level:Starter | Status: [Member] | Points: 10
The above Code is not working Properly because Personal Details is method but in main method we are use like a type. Please Rectify the Error in the above program.

Login to post response