In this topic, you will learn about, Different data types available in Visual Basic.
Data types specify memory location size and type for the variable.
Visual Basic provides various data types:
- Byte: It specifies integer type variable and it consumes 1-byte memory space in which we can store -127 to 127.
- Short: It specifies integer type memory location in which we can store any numeric value. It consumes two-byte memory space and store values between -32708 to 32767.
- Integer: It consumes 4-byte memory space for an integer variable in which we can store values between -231 to +231-1.
- Single: It creates a memory for the real variable and it consumes 4-byte memory space. Single can be store decimal integer or fractional value where we can specify six decimal digits.
- Long: It is used to specify integer variable allow to hold -363 to +263-1.
- Double: It is used to create a real type variable and it consumes 8-byte memory space.Double store 15 decimal digits.
- Date and Time: Using this datatype we can create a 10-byte memory space in which we can store date and time.
- String: It consumes 16-byte memory space but we can store more than size.
- Variant: this Data type can be used as the variant keyword for declaration and also create a directory. It consumes 20-byte memory space in which we can store any type of value.
- Bool: Using this datatype we can create a boolean type variable where the boolean variable stores true or false value.
Comment below if you have queries related to the above topic, Different data types available in Visual Basic.