3 ms·
No such thing as null? No. But in Kotlin non-nullable types are the default. In C++ references are non-nullable. Both include nullable types too. In that spec
by kaashif 4y ago
No such thing as null? No.
But in Kotlin non-nullable types are the default. In C++ references are non-nullable. Both include nullable types too.
In that specific example, String can't be null in Kotlin and neither can string in C++, although you can make them nullable by using e.g. a pointer or an optional type.
Having everything be nullable like in Java is unarguably 100% a mistake.