Variables

  • Note

    1. Variable Declaration & Usage

    Variable Declaration is a statement that provides the variable name and its type, allowing the program to allocate memory for storing values.

    1. = sign is used to store the data to the variable. This statement gives the instruction to the CPU to store the data in the memory.

    2. left part of the = is variable name

    3. right part of the = is data

    4. Left part of the = , ie variable name is used to read the data from the memory. This statement gives the instruction to the CPU to read the data from memory and return to the program

  • Type of variables
    Variable TypeData TypeMultiple data allowed?
    IntegerInteger data onlyNo
    String Any dataNo
    Boolean 1 or 0 , true 0r falseNo
    DatedateNo
    ArrayAny dataYes
    ObjectAny dataYes