
Learn Kotlin null safety and compare Kotlin and Java type systems. Master nullable and not null types, platform types, and not null assertion, safe call, Elvis, let, and lateinit.
Explore why Kotlin introduces nullable types to prevent null pointer exceptions by enforcing null safety at compile time, reducing runtime crashes.
Explore how Java and Kotlin handle types, and how Kotlin's nullable types prevent null pointer exceptions at compile time.
Explore how Kotlin enforces null safety by distinguishing nullable and non-nullable types, preventing NullPointerExceptions at compile time with checks and the safe call operator in Java and Kotlin types example.
Discover how Kotlin's null safety prevents null pointer exceptions with nullable types. Designers improved the Java type system to support safer code before the code compiles.
Learn how the safe call operator makes Kotlin null safety easier by allowing you to call methods on nullable types in one line, avoiding runtime null pointer errors.
Leverage the Elvis operator to supply default values for Kotlin nullable types, using the safe call operator to keep logic concise in a single line.
Explore the Elvis operator in Kotlin null safety with safe calls, default values, and throw expressions, showing concise handling of string length when inputs are null.
Use safe casts in Kotlin to convert nullable types without risking runtime exceptions from the as operator. Combine safe casts with Elvis operator to yield null when casting isn't possible.
Explore Kotlin casting with the as operator, smart casts via is checks, and the safe cast operator with Elvis to avoid ClassCastException in runtime.
Learn to use not-null assertions, a double exclamation mark operator that converts nullable types to non-null, throwing a null pointer exception when null.
Demonstrate how the not null assertion converts a nullable string to a non-null type and how a null value causes a runtime null pointer exception, guiding safe use in Kotlin.
Use the let function to work with nullable types, turning the object into a lambda parameter and accessing it as 'it' to safely pass a non-null value.
Explore Kotlin null safety with the let function and safe calls, using smart casts to pass non-null data to methods like processData, via lambdas and the it parameter.
The lateinit keyword lets properties be initialized later in frameworks, such as Android activities in onCreate, avoiding constructor initialization but may require safe calls and reduce readability.
Learn how the late initialized keyword in Kotlin lets properties initialize later, improving readability by avoiding not null assertions and safe calls.
Explore platform types in Kotlin and how interop with Java gives developers flexible but risky null handling, balancing safe and unsafe operations without automatic null checks.
Explore platform types in Kotlin with Java interop. Learn how a Java class's last name may be nullable, and use safe calls and the Elvis operator to prevent runtime errors.
Master Kotlin null safety concepts quickly by exploring Kotlin’s interoperable Java types, platform types, and key operators like safe call and Elvis, plus non-null and smart casts.
This course is a quick paced introduction into Kotlin null safe type system.
During this 30 min course you will learn the differences between the Java and Kotlin type systems.
You will see how Kotlin will help you handle the notorious NullPointerException at compile time rather than at runtime.
By the end of the course you will be very comfortable with Kotlin nullability which is one of the main advantages and core features of the language.
You will find out the differences between nullable, not null and platform types.
You will learn about safe the call operator, the Elvis operator, the safe cast operator, the not null assertion, the let function and some other important techniques of working with nullable types in Kotlin.
Some knowledge of java is welcome but not required.
This course is for you if you are just starting our with Kotlin!