C# Class question
C#
2
Posts
2
Posters
0
Views
1
Watching
-
I may be an Idiot for asking this but it is friday and my brain is fried, lol. But in a C# Class can you just declare an Enum? Other Classes will use this single Enum as a standard across the application.
Yes, you can. For example:
public class IceCream
{
protected IceCream()
{
// Protected constructor
}public enum Flavor
{
Vanilla = 0,
Chocolate,
Strawberry,
}
}Client classes can then refer to objects of type
IceCream.Flavor
that could have a possible value ofIceCream.Flavor.Vanilla
. /ravi My new year's resolution: 2048 x 1536 Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com