Issue
Below code snippet gives error. Can someone guide why this is happening?
class Test() private constructor {
constructor(name: String): this() {
println("test called constructor $name")
}
}
fun main() {
Test("hk")
}
Removing private constructor , this is working.
I tried to resolve this on my side. but I got no success.
Solution
class Test private constructor() {
constructor(name: String): this() {
println("test called constructor $name")
}
}
fun main() {
Test("hk")
}
Answered By – Sunny
Answer Checked By – Dawn Plyler (FlutterFixes Volunteer)