Hi all,
The following does work, but not as I expected.
If I use an enum I normally don't have to prefix it with a class name.
Here it seems the only option. Can anyone tell me why?
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
MyEnums E = new MyEnums();
// Why do I have to use this instead of E.Pets
// or simply Pets.cat;?
// Looks like some static behaviour, but I don't understand why...
E.P = MyEnums.Pets.cat;
}
}
class MyEnums
{
public enum Pets
{
cat,dog,tiger
}
public Pets P;
}
}