0
0
Kotlinprogramming~5 mins

Int, Long, Float, Double number types in Kotlin - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the Int type in Kotlin?
Int is a number type in Kotlin that stores whole numbers without decimals. It uses 32 bits and can hold values from -2,147,483,648 to 2,147,483,647.
Click to reveal answer
beginner
How is Long different from Int in Kotlin?
Long is a number type that stores bigger whole numbers than Int. It uses 64 bits and can hold values from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.
Click to reveal answer
beginner
What does the Float type represent in Kotlin?
Float is a number type for decimal numbers (numbers with fractions). It uses 32 bits and is less precise than Double. You write a Float number with an 'f' or 'F' at the end, like 3.14f.
Click to reveal answer
beginner
Explain the Double type in Kotlin.
Double is a number type for decimal numbers with more precision than Float. It uses 64 bits and is the default type for decimal numbers in Kotlin.
Click to reveal answer
beginner
How do you write a Long and a Float literal in Kotlin?
To write a Long number, add 'L' or 'l' at the end, like 123L. To write a Float number, add 'f' or 'F' at the end, like 3.14f.
Click to reveal answer
Which Kotlin type would you use to store the number 5000000000?
ALong
BInt
CFloat
DDouble
What suffix do you add to a number to make it a Float in Kotlin?
AL
Bf
CF64
Dd
Which type is the default for decimal numbers in Kotlin?
AInt
BLong
CFloat
DDouble
What is the size in bits of the Int type in Kotlin?
A64 bits
B16 bits
C32 bits
D128 bits
Which type can store the largest whole number?
ALong
BFloat
CInt
DDouble
Describe the differences between Int, Long, Float, and Double in Kotlin.
Think about size, precision, and whether the number has decimals.
You got /4 concepts.
    How do you write literals for Long and Float types in Kotlin? Give examples.
    Remember the suffix letters for each type.
    You got /2 concepts.