What is DATA?
Data is the representation of anything.
so it can be either constant or variables.
So from the basic mathematical definition:
Constant: Entity whose value can not be changed.
Variable: Entity whose value can be changed.
consider we have an equation:
(x-5)(x+5) = 0
then the value of x will be -5 and 5.
You can notice that value of x is changing. so it is called variable and the value 5 or -5 is constant.
we will mainly focus on variable.
so in programming terms, variables are defined as:
Variables are just a placeholder.
There are 2 types of Data:
- primitive
- Non primitive
Primitive types are system defined data types. They are:
- int
- short
- long
- byte
- float
- double
- boolean
- char
First 4 of them are used for round number integers.
5th and 6th one are used for decimal number representation
7th is used as condition- either true or false
8th is used for alphabets representation.
Each data type has a default size and range.
Now let's learn its implementation
The non-primitive data types are referred as user defined data types. Example:
- String
- Array
- objects ..etc
we will learn non-primitive data types in coming posts.
Comments
Post a Comment