Are you talking about using Optional or things like that in java? That's pretty recent so you can't say that's a property of a static language. And it brings its own problems with it.
Not all static languages give you this but the trend is pretty clear with Typescript, Swift, Kotlin etc.