‫In Kotlin, integers are numeric data types used to represent whole numbers.
‫Kotlin provides several integer data types with varying sizes, allowing you to choose the appropriate
‫type based on your memory and range requirements.
‫The first type is the byte.
‫The byte data type represents eight bit signed integers.
‫It's useful for conserving memory when you need to store small numbers in order to create a byte.
‫I'll start with a val or var keywords my byte.
‫This is the name of the variable.
‫My byte.
‫And here I need to specify the type of this variable is of type byte.
‫And here you assign a value to it.
‫For example 100.
‫The range of the byte is from -1 to 8 to 1 to 7.
‫So if you specify 1 to 9, for example, you can see that there is error here telling you that the integer
‫literal doesn't conform to the expected type byte.
‫So you exceeded the range of the by.
‫The maximum is 1 to 7.
‫The second data type is the short.
‫The short data type represents 16 bit signed integers, offering a larger range than byte, but smaller
‫than int.
‫It's suitable for integers that fall within this range between -3 to 7 86232767.
‫This is the range of the short.
‫In order to create a short.
‫I'll start with val or var specify my short and name, and here I specify the type which is short and
‫you can put like this.
‫If you exceed the range.
‫For example like this you have an error red line.
‫You need to respect the range from this number to this number.
‫When creating short variables.
‫The third type is int.
‫The end data type represents 32 bit signed integers, allowing you to store whole numbers from approximately
‫-2 billion to 2 billion.
‫To create an int, I start with val or var keyword my int and infer the type here and you can specify
‫your number.
‫The fourth type is the lung.
‫The lung data type represents 64 bit signed integers, providing a much larger range than int.
‫It's used for storing very large numbers.
‫In order to create the lung.
‫We start with val or var my lung.
‫I name it as my lung, and here I need to specify the type which is lung equals to this number.
‫The range of lung is from this number to this number.
‫When choosing an integer data type, consider the range of values you need to store.
‫Smaller data types like byte and short.
‫Consume less memory, but have a limited range.
‫Int is a common choice for general purpose integer storage, and lung is used for very large numbers.
‫Using the appropriate data type helps optimize memory usage and ensure your program can handle the values
‫it needs to represent.