You are developing a Kotlin application where you need to compare characters and their numerical equivalents. In this context, fill the blanks in the code provided so that it correctly compares a character to its unicode equivalent, also, compares two digits as their numerical values and prints their comparison results.
Characters. Char type
Comparing characters and digits in an application
Report a typo
Fill in the gaps with the relevant elements
fun main() {
val chA: = 'A'
val chB: Char = 'B'
println("Unicode comparison: ${chA.() < chB.toByte()}")
val ch1: Char = '1'
val ch2: Char = '2'
println("Decimal comparison: ${ch1 < ch2}")
} ___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.