Should you always use Optional?

Optional is primarily intended for use as a method return type where there is a clear need to represent “no result,” and where using null is likely to cause errors. … You should almost never use it as a field of something or a method parameter.

Sizin İçin Seçtik  Why is null better than Optional?

Leave a Reply

Your email address will not be published. Required fields are marked *