Hi all,
I was wondering why the following code compiles, with or without extra komma?
My feeling is it should not be there, but apparently it does not matter. Any comments would be more then welcome.
namespace ConsoleApplication1
{
class Program
{
public enum months
{
jan = 1,
feb = 2,
mar = 3,
apr = 4, // notice the extra comma
}
static void Main(string[] args)
{
int[] strangeInts = new int[3] { 1, 2, 3, }; // notice the extra comma
int total = strangeInts[0] + strangeInts[1] + strangeInts[2];
Console.WriteLine("The total is: {0}", total);
months strangeMonths = months.feb;
Console.WriteLine("The month is: {0}", strangeMonths);
Console.ReadKey();
}
}
}