3.1 Fundamentals Of Programming Flashcards
Name the two data types.
Primitive & Non-Primitive.
What do Primitive data types include?
- Byte.
- Short.
- Int.
- Long.
- Float.
- Double.
- Boolean.
- Char.
What do Non-Primitive data types include?
- String.
- Arrays.
- Classes.
How many Primitive data types are there in Java?
Eight.
Define a Byte data type.
Stores whole numbers from -128 to 127.
Define the size of a byte data type.
1 Byte (8 bits).
Define a Short data type.
Stores whole numbers from -32,768 to 32,767.
Define the size of a Short data type.
2 Bytes (16 bits)
Define an Int data type.
Stores whole numbers from -2,147,483,648 to 2,147,483,647.
Define the size of an Int data type.
4 Bytes (32 bits).
Define a Long data type.
Stores whole numbers from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.
Define the size of a Long data type.
8 Bytes (64 bits).
Define the data type Float.
Stores fractional numbers. Sufficient for storing six to seven decimal digits.
Define the size of the Float data type.
4 Bytes (32 bits).
Define a Boolean.
Stores true or false values.
Define the size of a Boolean.
1 Bit.
Define a char.
Stores a single character/letter or ASCII values.