Data Types and Their Range
Data Types and Their Range
md 2025-07-08
Listing data types for all programming languages is not practical in one answer due to the large number of
languages and their unique types, but I’ll give you a comprehensive overview of the most common data
types, followed by examples of how they're used in popular languages (like C, Java, Python, JavaScript, C++,
and more).
🔷 Python
int → 10
float → 3.14
bool → True / False
str → "hello"
list → [1, 2, 3]
tuple → (1, 2)
dict → {"name": "Snape"}
set → {1, 2, 3}
NoneType → None
🔷 Java
int → 10
float → 3.14f
double → 3.14159
boolean → true / false
char → 'a'
1/7
Data Types and Their Range.md 2025-07-08
String → "hello"
int[] → array
Object → class-based types
null → null
🔷 JavaScript
Number → 10 or 3.14
String → "hello"
Boolean → true / false
Object → {name: "Snape"}
Array → [1, 2, 3]
null → null
undefined → undefined
BigInt → 12345678901234567890n
Symbol → Symbol("id")
🔷C
int → 10
float → 3.14f
double → 3.14159
char → 'a'
_Complex → Complex number type
void → No return value (e.g., for functions)
🔷 C++
int → 10
float → 3.14
double → 3.14159
bool → true / false
char → 'a'
string → "hello" (std::string)
vector → dynamic array (std::vector<int>)
nullptr → null pointer
🔷 C#
2/7
Data Types and Their Range.md 2025-07-08
int → 10
float → 3.14f
double → 3.14159
bool → true / false
char → 'a'
string → "hello"
List<T> → Generic list
object → base class for all types
null → null
🔷 Go (Golang)
int → 10
float64 → 3.14
bool → true
string → "hello"
array → [3]int{1, 2, 3}
slice → []int{1, 2, 3}
map → map[string]int{"a": 1}
interface{} → any type (like `Object`)
nil → null equivalent
🔷 Rust
i32 → 10
f64 → 3.14
bool → true
char → 'a'
String → "hello".to_string()
&str → "hello"
Option → Some(value) / None
Vec → dynamic array
[] or
Array list [] Array [] List<> Vec
slice
Would you like this as a PDF, cheat sheet, or more details for a specific language or framework (like React,
Django, etc.)?
Great! Here's an expanded guide with data types and their ranges for major programming languages like C,
C++, Java, Python, JavaScript, C#, and Go.
✅ Note: Ranges depend on the number of bits used to store the type (e.g., 8-bit, 32-bit). Some
languages (like Python) handle big numbers automatically, while others (like C) have fixed ranges.
0 to 4,294,967,295
C / C++ int 32 -2,147,483,648 to 2,147,483,647
(unsigned int)
4/7
Data Types and Their Range.md 2025-07-08
−9,223,372,036,854,775,808 to
long long 64
9,223,372,036,854,775,807
−9,223,372,036,854,775,808 to
long 64
9,223,372,036,854,775,807
byte 8 0 to 255 —
ushort 16 0 to 65,535 —
uint 32 0 to 4,294,967,295 —
ulong 64 0 to 18,446,744,073,709,551,615 —
uint8 8 0 to 255 —
5/7
Data Types and Their Range.md 2025-07-08
✅ JavaScript only has one number type (IEEE 754 double precision). For very large integers, use
BigInt.
Size of char:
Python None
Java null
6/7
Data Types and Their Range.md 2025-07-08
C# null
Go nil
Swift nil
7/7