ProgrammingIntermediatekotlin

Kotlin Fundamentals

Null safety, data classes and coroutines on the JVM.

Kotlin's pitch is that it removes whole categories of defect from Java without making the code less expressive. The mechanism is in the type system: a reference is non-nullable unless you write a question mark on it, and the compiler refuses code that could dereference null. This course works through that mechanism properly rather than treating `?.` as punctuation, then builds the data-model and functional idioms you will use daily - data classes, sealed hierarchies, the collection operators, extension and scope functions - and finishes on coroutines and Flow, which is where Kotlin's model of concurrency pays off. The examples target Kotlin 1.9 and later on the JVM.

4.6 (168) 540 students 244 min 23 lessons 200 XP on completion

What you will be able to do

  • Explain what the nullable type marker means and choose between ?:, ?. and !! deliberately
  • Predict when the compiler will and will not smart-cast a value to a non-null type
  • Model a closed set of states with a sealed hierarchy and handle it with an exhaustive when
  • Write collection transformations with map, filter, groupBy and sumOf without intermediate loops
  • Pick the right scope function - let, apply, also, run or with - for what a call returns
  • Launch concurrent work with coroutines and consume a lazy Flow without blocking a thread

Assessments

Dashboard