Why question mark (?) is used while assigning string to null? In Kotlin All Questions › Category: Kotlin › Why question mark (?) is used while assigning string to null? In Kotlin 0 Vote Up Vote Down chetan shidling asked 4 years ago fun main(args : Array<String>){var str : String? = null} 1 Answers 0 Vote Up Vote Down chetan shidling answered 4 years ago It is used to assign null to string. If we assign null to string without using a question mark then it will show an error.