Vidyalelo
Computer Science · Q241

Kotlin Programming MCQ for Competitive Exams, Interviews, and Certifications

Engineering and GATE · Computer Science · question 241

Q241

Which of the following is the correct way of declaring objects for class Book in Kotlin?

A.
Book b1 = new Book()
B.
val b1 = Book()
Answer
C.
var b1 = (Book) new()
D.
val b1 = (new) Book()

Answer: Option B

Solution

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