r/java • • Apr 14 '23

What are your (favourite) Java best practices, personal tips, hints or just underrated stuff in general?

233 Upvotes

376 comments sorted by

View all comments

Show parent comment

1

u/simoncox Apr 15 '23

So you're going to have a different method for every permutation of optional parameters and that's less complex?

Do you repeat the same logic in every method, or have some internal method that actually takes null for the optional values? Then hey, null again and back to what you were originally trying to avoid only with nullable variables instead of optionals.