Skip to content

Instantly share code, notes, and snippets.

@deepakmehra10
Created July 14, 2019 10:02
Embed
What would you like to do?
Option<String> value = Option.some("Deepak");
Option<String> value1 = Option.none();
System.out.println(value.map(a -> a).getOrElse("Default name")); // Deepak
System.out.println(value1.map(a -> a).getOrElse("Default name")); // Default name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment