Blog

Your dream job? Lets Git IT.
Interactive technical interview preparation platform designed for modern developers.

XGitHub

Platform

  • Categories

Resources

  • Blog
  • About the app
  • FAQ
  • Feedback

Legal

  • Privacy Policy
  • Terms of Service

© 2025 LetsGit.IT. All rights reserved.

LetsGit.IT/Categories/Kotlin
Kotlinhard

Java interop — what are platform types (`String!`) and why are they risky?

Tags
#interop#platform-types#nullability
Back to categoryPractice quiz

Answer

A platform type comes from Java where nullability is unknown, so Kotlin treats it as “nullable or non-null” (`String!`). If you treat it as non-null but it’s actually null, you can still get an NPE; prefer proper nullability annotations and safe handling.

Related questions

Kotlin
Companion object vs top-level members: when would you use each?
#kotlin#companion#top-level