Declaring Long

Report a typo

Whoa! This problem is much more complex than the usual one and requires knowledge of type conversion. If you're feeling up to the challenge, brace yourself and good luck! Otherwise, you can skip it for now and return any time later

What values will be defined as Long if we insert them into this piece of code?

val magic = 2_000_000_000
val giant = 3_000_000_000
// insert here

Tip: The maximum number that can be used as Int in Kotlin is 2_147_483_647. Think about the type of magic and giant and then keep in mind type coercion.

Select one or more options from the list
___

Create a free account to access the full topic