Enum value duplication : Enum « Data Type « VB.Net Tutorial

Home
VB.Net Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statements
5.Date Time
6.Class Module
7.Development
8.Collections
9.Generics
10.Attributes
11.Event
12.LINQ
13.Stream File
14.GUI
15.GUI Applications
16.Windows Presentation Foundation
17.2D Graphics
18.I18N Internationlization
19.Reflection
20.Regular Expressions
21.Security
22.Socket Network
23.Thread
24.Windows
25.XML
26.Database ADO.net
27.Design Patterns
VB.Net
VB.Net by API
VB.Net Tutorial » Data Type » Enum 
2.20.9.Enum value duplication
Public Enum AccessLevel
    Level1
    Level2
    Level3

    AliasLevel1 = Level1
    AliasLevel2 = Level2
    AliasLevel3 = Level3
    AliasLevel4 = Level3
End Enum

public class Test
   public Shared Sub Main
        Dim access_level As AccessLevel = AccessLevel.Level1
        Console.WriteLine(access_level.ToString())
        Console.WriteLine(AccessLevel.Level1.ToString())
        Console.WriteLine(AccessLevel.Level2.ToString())
        Console.WriteLine(AccessLevel.Level3.ToString())
   End Sub
End class
Level1
Level1
Level2
AliasLevel3
2.20.Enum
2.20.1.Define Enum and assign value
2.20.2.Define and use Enum as Integer
2.20.3.Declare Enum variable
2.20.4.Public Enum type
2.20.5.Assign value to Enum elements
2.20.6.Assign value to only one Enum element
2.20.7.Cast Integer to Enum value
2.20.8.Convert Enum to Integer
2.20.9.Enum value duplication
2.20.10.Compare Enum element using logic operator
2.20.11.Converting an enumerated value to a string.
2.20.12.Standard Enumeration Format Specifiers
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.