1

Related:

Is it safe to assume an int will always be 32 bits in C#?

The linked question asks whether it is "safe to assume that an int will always be 32 bits in C#". The accepted answer states that "the C# specification rigidly defines that int is an alias for System.Int32 with exactly 32 bits".

My question is this: does this hold true for VB.Net's Integer? Is it safe to assume that Integer will always be an alias for int32?

Community
  • 1
  • 1
Brian Beckett
  • 4,742
  • 6
  • 33
  • 52

2 Answers2

7

Yes.
The Integer type will never change.

The spec (7.3 Primitive Types) says:

The integral value types Byte (1-byte unsigned integer), Short (2-byte signed integer), Integer (4-byte signed integer), and Long (8-byte signed integer). These types map to System.Byte, System.Int16, System.Int32, and System.Int64, respectively. The default value of an integral type is equivalent to the literal 0.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
0

VB.Net doesn't have an "int", it has an "Integer" type. The Integer type is an alias for System.Int32. So no, this will not change.

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794