Unit is like Java's void
# getting-started
d
Unit is like Java's void
r
diesieben07: In a way. Java's
void
plays the roles of both
Unit
and
Nothing
.
d
No, Java does not have a
Nothing
😛
r
Correct. So a function that cannot return still says it's
void
. The link @sigurdsa posted explains it pretty well.
d
Yes, I know that. But there is no way to express "this never returns" in Java.
r
Ah, yes. I see what you mean now. That is correct.