The data type of a variable is an attribute that tells what kind of data that a value can have.
Java programming supports eight primitive types under the following four categories which are as under:
2. Real Numbers:
Real point numbers are also called as floating point numbers and hence needs to be stored in a data type different from integers
Character datatype stores the characters and special Characters.The size of character data type is 2 bytes.
Java programming supports eight primitive types under the following four categories which are as under:
- Integers:The datatype integer is used to store the numbers other than real point numbers.
Under integer sub types are:
2. Real Numbers:
Real point numbers are also called as floating point numbers and hence needs to be stored in a data type different from integers
Under real number type, sub types are:
- float: The size of float is 4 bytes.
- double: The size of double is 8 bytes
Character datatype stores the characters and special Characters.The size of character data type is 2 bytes.
4.Boolean:
Boolean means that it can either store 0 or 1.The size of Boolean is 1 byte
Boolean means that it can either store 0 or 1.The size of Boolean is 1 byte
No comments:
Post a Comment