Data Type
Quiz Link : https://take.quiz-maker.com/QJR4DF2A9
different sizes and values that can be stored in the variable.
- Basic mean of the data type is What is the type of data
- Example:
- 10 is a data stored in memory so the type of this data is Integer type .
- 'manvik' is a data stored in memory so the type of this data is string type.
- false is a data stored in memory so the type of this data is Boolean.
There are 2 type of Data types:
Primitive data types(value type):
- Predefined by the language and is named by a reserved keyword.
- Created only in stack.
- Boolean, char, int, byte, short, double, float, long these types of data types called primitive data types.
Non-primitive data types(reference type):
- Created by the programmer and is not defined by Java .
- Classes, Arrays, interfaces etc. are non-primitive data type.
- Created in Heap.
- Boolean data type: Boolean data type only work on True and false value.
Ex: engineers are smart 🧠 true or false
answer : Ture ☺.
- character data type(char): Used to store Character.
Ex: 'A' is character can store in memory by the help of char keyword.
- Integer data types: Integer data type can take values in range -2147483648 to +2147483647.
=>parts:
- byte(save memory(-128-127)),
- short(save memory(-32,768 to 32,767)),
- int
- long(The long data type is used when you need a range of values more than those provided by int(-9,223,372,036,854,775,808(-2^63) to 9,223,372,036,854,775,807(2^63 -1)))
- Floating : Store double-precision floating point value (unlimited range).
Ex: 1.8 is a floating point value.
=>parts:
Primitive Data type (soon)
Comments
Post a Comment