|
3. VB.Net Constants (Const kPI Double = 3.1459)
In VB.Net, you define constants with the Const keyword.
All constants are part of a class (no global constants) but you can make a constant public and have access to it using ClassName.ConstantName so long as you have added the class to the project. This works even without creating the class as if the public constants were static, but you cannot use the Shared keyword.
Constants must be of an integral type (sbyte, byte, short, ushort, int, uint, long, ulong, char, float, double, decimal, bool, or string), an enumeration, or a reference to null.
18 years ago, and updated 17 years ago
|