Hi Guys ,
There are multiple reasons for getting this error .
1. If you have a class for which you are trying to create an object and you have missed to specify any of the class variables while creating the object, you might face the exception like :
The boolean literal does not conform to the expected type String .
Take a look at the program below :
class Student(
val name: String,
var age: Int
)
fun main(args: Array<String>) {
val student= Student(1)
println(student.name)
println(student.age)
}
There are multiple reasons for getting this error .
1. If you have a class for which you are trying to create an object and you have missed to specify any of the class variables while creating the object, you might face the exception like :
The boolean literal does not conform to the expected type String .
Take a look at the program below :
class Student(
val name: String,
var age: Int
)
fun main(args: Array<String>) {
val student= Student(1)
println(student.name)
println(student.age)
}