What is Data types?
Data types are used to store the data.
there are two types of data types.
*Primitive
*non-primitive
What is primitive?
Primitive is a fixed data types.
Primitive data types - includes byte, short, int, long, float, double, boolean and char.
1.Byte.
Stores whole numbers from -128 to 127.
2.Short.
Stores whole numbers from -32,768 to 32,767.
3.int.
Stores whole numbers from -2,147,483,648 to 2,147,483,647.
4.Long.
Stores whole numbers from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.
5.float.
Stores fractional numbers. Sufficient for storing 6 to 7 decimal digits.
6.Double.
Stores fractional numbers. Sufficient for storing 15 to 16 decimal digits.
7.Boolean.
Stores true or false values.
8.Char.
Stores a single character/letter or ASCII values.
*Non-primitive *
Non-primitive data types are called reference types because they refer to objects.
1.String
2.Object
3.Array
What is variables?
Data types are used variables.they are two types of variables.
1.Global.
2.Local.
1.Global Variables
Variables declared on out side the main methods.
2.Local Variables
Variables declared on inside the main methods.
Top comments (0)