How to an Enumeration, Days, is declared in C#



How to an Enumeration, Days, is declared in C#

using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Text;  
using System.Threading.Tasks;  
namespace enumDaysByName   
{  
    enum DaysByName   
    {  
        Sunday = 1, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday  
    }  
    class Enum   
    {  
        static void Main(string[] args)  
        {  
            DaysByName today = DaysByName.Sunday;  
            Console.WriteLine("Today is : {0}", today);  
            Console.WriteLine("5 * 7 = {0}", (int) DaysByName.Thursday * (int) DaysByName.Saturday);  
        }  
    }  
}

0 Comment's

Comment Form

Submit Comment