Imran Rizvi
Imran Rizvi

Reputation: 7438

A get or set accessor expected enum

I am getting the following compilation error when trying to create an Enum:

"A get or set accessor expected"

This is the code:

private Enum HolidayCalendarType
{
    BusinessDays,
    CalendarDays,        
}

What is the issue?

Upvotes: 2

Views: 3277

Answers (1)

Imran Rizvi
Imran Rizvi

Reputation: 7438

The keyword enum should be in lower case when defining it. The following declaration works:

private enum HolidayCalendarType
{
    BusinessDays,
    CalendarDays        
}

Whereas Enum (Pascal case) helps to provide the base class for enumerations.

Upvotes: 10

Related Questions