Created
July 14, 2019 10:08
-
-
Save deepakmehra10/77a958b62ae16796bc15f169ac9fb0d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Lazy<String> name = Lazy.of(() -> "Deepak"); | |
System.out.println(name.isEvaluated()); //false | |
System.out.println(name.get()); //Deepak | |
System.out.println(name.isEvaluated()); //True | |
System.out.println(name.get()); //Deepak, from cache |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment