I am testing the following example at: http://www.dotnetperls.com/enum-vbnet
but apparently this example is wrong. The bold portion shows "Type 'Item' is not defined".
Dim v As Item
= New Item
Question: How can I change this example to make it work?
Example title: Default
An Enum has a default value. This corresponds to the value that equals 0 within the Enum type, which is by default the first listed one. When part of a class, an Enum does not need initialization to this default value.
The default values of an enum proceed up from 0.
So the first is zero,
the second is one,
and the third is two. Initializing an Enum to zero is a performance negative. It will result in additional yet unneeded steps.
VB.NET program that uses Enum, default value
''' Public enum.
Public _level As Level
' The default value for an enum is the one equal to 0.
Dim v As Item = New Item