H
Harold Hsu
Hi,
Originally, I have defined the following Enum within a namespace (outside a
class):
Public Enum UserRole
Admin
Manager
User
End Enum
And then later I learned that an Enum can be nested in a class. So I can
have:
Public Class User
Public Enum Role
Admin
Manager
User
End Enum
End Class
So instead of UserRole.Admin, I can say User.Role.Admin
My questions are:
1. Choosing one over the other is just a matter of preference?
2. If I access the named constant using User.Role.Admin, is the enum
treated like a static member?
Thanks,
Harold
Originally, I have defined the following Enum within a namespace (outside a
class):
Public Enum UserRole
Admin
Manager
User
End Enum
And then later I learned that an Enum can be nested in a class. So I can
have:
Public Class User
Public Enum Role
Admin
Manager
User
End Enum
End Class
So instead of UserRole.Admin, I can say User.Role.Admin
My questions are:
1. Choosing one over the other is just a matter of preference?
2. If I access the named constant using User.Role.Admin, is the enum
treated like a static member?
Thanks,
Harold