Int

This type represents a 32-bit signed integer. When a variable is declared with this type, the value space of the variable is the set of integers, that is, the variable can only hold integer values. We have seen the use of this type several times in our examples so far. The Int type can hold integer values within the range of -2,147,483,648 to 2,147,483,647.

Get Kotlin Programming By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.