Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi. i want use enum in enum , for example:
CarEnum.Car1.Color
CarEnum.Car1.Tires
CarEnum.Car2.Speed
CarEnum.Car2.Fuel
public enum CarEnum{ Car1, Car2}
but how to add another enum in this enum ?
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
Answer accepted by question author
Try an alternative:
public static class CarEnum
{
public enum Car1 { Colour, Tires };
public enum Car2 { Speed, Fuel };
}
Consider namespaces too.