Primitive Data Types:
• Integers
• Subtypes:
• Byte: 8-bit signed two's complement integer
, Subtypes of Integers:
• Byte:` 8-bit signed two's complement integer
• Short: 16-bit signed two's complement integer
• Int: 32-bit signed two's complement integer (most commonly used)
• Long: 64-bit signed two's complement integer
Memory Allocation and Limitations:
• Byte: -128 to 127
• Short: -32,768 to 32,767
• Int: -2,147,483,648 to 2,147,483,647
• Long: -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
Variable Assignment and Declaration Syntax:
Java
byte byteVar = 0;
short shortVar = 0;
int intVar = 0;
long longVar = 0;
C++
byte byteVar = 0;
short shortVar = 0;
int intVar = 0;
long longVar = 0;
Python
byteVar: int = 0
shortVar: int = 0
intVar: int = 0
longVar: int = 0
• Integers
• Subtypes:
• Byte: 8-bit signed two's complement integer
, Subtypes of Integers:
• Byte:` 8-bit signed two's complement integer
• Short: 16-bit signed two's complement integer
• Int: 32-bit signed two's complement integer (most commonly used)
• Long: 64-bit signed two's complement integer
Memory Allocation and Limitations:
• Byte: -128 to 127
• Short: -32,768 to 32,767
• Int: -2,147,483,648 to 2,147,483,647
• Long: -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
Variable Assignment and Declaration Syntax:
Java
byte byteVar = 0;
short shortVar = 0;
int intVar = 0;
long longVar = 0;
C++
byte byteVar = 0;
short shortVar = 0;
int intVar = 0;
long longVar = 0;
Python
byteVar: int = 0
shortVar: int = 0
intVar: int = 0
longVar: int = 0