Vidyalelo
Computer Science · Q211

Kotlin Programming MCQ for Competitive Exams, Interviews, and Certifications

Engineering and GATE · Computer Science · question 211

Q211

How do you declare a String in Kotlin?

A.
val str: String = "Hello, World!"
Answer
B.
String str = "Hello, World!"
C.
val str = String("Hello, World!")
D.
String str = new String("Hello, World!")

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board