int

The common integer type in many languages, holding whole numbers within a fixed range set by its size in bits.

In more detail

Values outside the range overflow, usually wrapping around silently, so larger numbers need a wider type. The size depends on the language.

Examples

port := 5432  // int, 64 bits on modern systems
var retries int64 = 3
164 / 200  // 0: integer division
Java: int is 32 bits, from about minus 2.1 billion to plus 2.1 billion; its wrapper class is Integer; use long beyond that.
int count = 12;

Related terms

Taught in

References

Certification courses