Tuesday, 15 September 2015

Class 8 - Data Type in VB

A data type determines what type of values a variable can hold.
In numbers we have different types like 5(whole number), 6.9(decimal number).

The computer memory is made up of storage areas which will hold the values. 

When we give a value to a variable, the computer will allocate space in the memory to hold the variable. The storage space will be different for different values, based on the type of value.

Data types   :

Natural Numbers 

  • byte
  • integer
  • long
Byte : Number ranges from 0 to 255.
Integer : Larger than byte. Ranges from -32,768 to 32,767
Long : It can hold more than integer. To store very large number.

Decimal Numbers 

  • Single
  • Double

Single : To store decimal values. Less Precision.
Double :  Large decimal numbers. Very precise values.

String  :
It is also called alphanumeric (i.e) alphabets and numbers. It can be a word, group of words, numbers .

Boolean :
This value can be either true or false.

Variant :
It can represent any value.

Date :
It stores vales from 1/1/100 to 12/3/9999.

No comments:

Post a Comment