Q246
What is the correct syntax to convert the String "42" to a Long in Kotlin?
A.
val l: Long = (Long)"42"
B.
val l: Long = Long.parselong("42")
C.
val l: Long = <Long>"42"
D.
val L: Long = "42".toLong()
AnswerAnswer: Option D
Solution
Answer: Option D
No explanation is given for this question Let's Discuss on Board