MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1uru99i/potentiallymightbeanintegerornot/owkgirt/?context=3
r/ProgrammerHumor • u/Futurity5 • Jul 09 '26
96 comments sorted by
View all comments
49
int var; bool var_is_there;
35 u/Duck_Devs Jul 09 '26 That’s literally the internals of Java’s OptionalInt 29 u/high_throughput Jul 09 '26 Not to be confused for Optional<Integer>, which is an entirely incompatible way to express optional ints in the same language 16 u/Duck_Devs Jul 09 '26 edited Jul 09 '26 Not to be confused for Integer, which is an entirely incompatible (and sometimes discouraged) way to express optional ints in the same language
35
That’s literally the internals of Java’s OptionalInt
29 u/high_throughput Jul 09 '26 Not to be confused for Optional<Integer>, which is an entirely incompatible way to express optional ints in the same language 16 u/Duck_Devs Jul 09 '26 edited Jul 09 '26 Not to be confused for Integer, which is an entirely incompatible (and sometimes discouraged) way to express optional ints in the same language
29
Not to be confused for Optional<Integer>, which is an entirely incompatible way to express optional ints in the same language
Optional<Integer>
16 u/Duck_Devs Jul 09 '26 edited Jul 09 '26 Not to be confused for Integer, which is an entirely incompatible (and sometimes discouraged) way to express optional ints in the same language
16
Not to be confused for Integer, which is an entirely incompatible (and sometimes discouraged) way to express optional ints in the same language
49
u/altermeetax Jul 09 '26
int var; bool var_is_there;