srikotesh
asked on
Is there any advantages using Optional rather than checking list is null or empty
Hi Experts,
Optional.ofNullable(list). isPresent( )
if(!list.isEmpty() && list!=null)
what is the difference b/w the above two statements?
what is the advantage use of Optional
Optional.ofNullable(list).
if(!list.isEmpty() && list!=null)
what is the difference b/w the above two statements?
what is the advantage use of Optional
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.