Loading lesson…
Level 1 · Apprentice0 XP
Make the type system carry the null checks, and copy values instead of changing them.
Step 1 / 6
ProblemIn Java any reference can be null and nothing warns you. The crash appears in production, far from the line that returned null.
← → step
Before this: Kotlin for a Java developer
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Write fun initials(user: User?): String that returns the first letters of first and last name in upper case, or "?" when the user or either name is missing. No !! allowed.