When to Not Return Optional. Because Optional is a wrapper and value-based class, there are some operations that can’t be done against Optional object. Many times, it’s just simply better to return the actual type rather than an Optional type .
When to Not Return Optional. Because Optional is a wrapper and value-based class, there are some operations that can’t be done against Optional object. Many times, it’s just simply better to return the actual type rather than an Optional type .