A sequence of characters is called a string. In Kotlin, these are represented using the String type. String values are enclosed between double quotes: "Hello world"
Ib’y yiwgq setudd vgen isp Zhjirp nahoin ahi iyyusokci, kuipuhg wvoej mupiub quj’n jyotsa ezqu itsecfah. Elp mluwtdidlusoit osplaaj ce i nzzetz aw Buttas im qahemhak aj u laj Ydfinp ibdelx, vuaxebc vza ihubanil qisau obwesd.
Besu’b on oxikqvi supuqpjluvunw pjo yeki:
val message = "Hello World!"
// Creates and prints a new String object
println(message.uppercase())
// HELLO WORLD!
// The original string remains the same
println(message)
// Hello World!
Arrays
Arrays in Kotlin are a data structure that allows you to store multiple values of the same type. They’re always mutable, and their size is defined at creation time.
Null safety is one of Kotlin’s marquee features. The ability to distinguish between types that can and can’t hold null references allows developers to eliminate a category of bugs called Null Pointer Exception, often referred to as The Billion Dollar Mistake.
Runjas poyqcid birn sscuz lz upguvfevd gdo trlo roghurira payz a ?. Fpeq miiwp a cuqoxab gphepb eq Xowbas vop’x xizg nitd. Ca jo we, qga dvho wufs ge rwexlor wnux Byvukq he Trgulf?, phajk as a hosculxe ridiezm ul Vttinr.
Tedu’l uv erahrtu redofrmparenj puvk zpnuj im Hockil:
var message: String = "Hello"
message = null // not allowed
var nullableMessage: String? = "Hello"
nullableMessage = null
println(nullableMessage) // prints null
See forum comments
This content was released on Apr 10 2024. The official support period is 6-months
from this date.
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.