It describes the possible operations on the data and the storage method.
Data types
(Agarwal & Bansal, 2023)
_______ are built into the Java language. These are data that are not objects and have no
methods. The Java compiler has detailed instructions on the valid operations this data type supports.
Primative Datatypes
are built into the Java language. These are data that are not objects and have no
methods.
Primitive Data Types
The name will be stored as characters, the age
will be stored as a numeric value, and the address will be stored as an alphanumeric value, what is this? .
Data Types
Recite the 8) Primitive types that Java defines.
•Byte
•Short
•Int
•Long
•Float
•Double
•Char
•Boolean
what is the bit size of Byte?
8
what is the bit size of Short?
16
what is the bit size of int?
32
what is the bit size of Long?
64
what is the bit size of Float?
32
what is the bit size of double?
64
what is the bit size of char ?
8
what is the bit size of boolean?
1
Java defines Byte, Short, Int, and Long as?
Integer Data Types
It defines the sign of an integer
value, and Java manages it differently by adding a special “unsigned right shift” operation.
High-order bit
The smallest integer type that represents a small number.
Byte
An integer is considered _____ if its value is between -32768 and 32767. This data type
declare a variable that can hold numbers in that range.
Short
A hexadecimal number can also be initialized as a Short variable instead of a normal decimal integer.
So, the 3001 integer can be written as
0x4A8
This data type can handle larger numbers and is considered the best choice when an integer is
needed because when Byte and Short values are used in an expression, they are promoted to ___
automatically.
int
This data type holds a number higher than a regular integer. The ____ integer is a variable that
can hold a very large number. A capital letter ‘L’ is placed right after the value.
Long
Floating Point Types are used when evaluating an expression that needs
fractional accuracy such as the computation of square root or a transcendental (sine and cosine).What are these?
•float
•double
A real number qualifies as a single precession
when it only needs a limited number of bits. Single precision takes half the space of a double
precision and is much faster on some processors. What data type is this?
Float
_____ precision can be faster than single precision on modern processors that have been
optimized for high-speed mathematical calculations. It can handle larger numbers than Float.
Double