Practice with Variable Declaration and Initialization 0
Write a snippet of code—not a function—that:
- declares a variable
lucky
of typeChar
and initializes it to8
- declares a variable named
eachDay
of typeDouble
and initializes it to1.0
- declares a variable
age
of typeInt
and initializes it to88
- declares a variable named
learnCSOnline
of typeBoolean
and initializes it totrue
Note that because Kotlin performs type inference, you can and should solve this problem without explicitly specifying any types.