enum types

P

Pohihihi

so in
enum MyEnum { one, two, three }

'MyEnum' is a ref type but in

MyEnum a = MyEnum.one

'a' is a value type?
 
J

Jon Skeet [C# MVP]

Pohihihi said:
so in
enum MyEnum { one, two, three }

'MyEnum' is a ref type but in

MyEnum a = MyEnum.one

'a' is a value type?

No, 'a' is a variable. MyEnum is a value type, but System.Enum is a
reference type.

Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top