Static type systems have scopes in how much they type. Some newer ones add nullable annotations, like kotlin or swift, others don't have it yet.
I hope java gets native support for @nullable, but for now we have stuff like error prone and @nullable annotations.