Enumertors in VB.NET
This article defines the Enumerator with a example in VB.NET.
In this article You will learn How to use Enumerators in VB.NET.
Use enum keyword.
Starts with 0 and incremented by 1.
Enumeration is a related set of constants. They are used when working with many constants of the same type. It's declared with the Enum keyword.
enum Days as byte
dim d as days=days.Tue;
- Default allocation is for int and You can define the datatype.
enum Numbers as byte
Use sizeof() operator to get size of items
Code define the Enumerator:
Enum Days As Byte
Sun = 1
Public Shared Sub Main()
Dim d As Days = Days.Tue
This article shows that the value start with the zero and is increment by 1. sun day value is define 1 and it automatically increment the value by 1 till the tue. so the tue value is 3 .