Demonstrating basic data types in an application

Report a typo

Imagine you are developing a Kotlin application and you have to demonstrate the use of various basic types such as Byte, Short, Int, Long, Float, Double, Boolean, Char, and String. Reorder the provided lines of code so it declares the above-mentioned types, initializes them with appropriate values and prints them all in a single statement.

Reorder lines using drag or arrows. Adjust indentation with left buttons
                }
              
                val charExample: Char = 'K'
              
                val intExample: Int = 1000
              
                val booleanExample: Boolean = true
              
                val byteExample: Byte = 10
              
                val shortExample: Short = 100
              
                val stringExample: String = "Kotlin"
              
                println("Byte: $byteExample, Short: $shortExample, Int: $intExample, Long: $longExample, Float: $floatExample, Double: $doubleExample, Boolean: $booleanExample, Char: $charExample, String: $stringExample")
              
                val longExample: Long = 10000L
              
                val doubleExample: Double = 12345.6789
              
                fun main() {
              
                val floatExample: Float = 123.45F
              

Create a free account to access the full topic