-
-
Save enebo/7e11bde5c0f981a843b36266c4060913 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
import java.util.function.Supplier; | |
public class A { | |
public static double squareLazy(Supplier<Double> lazyValue) { | |
return Math.pow(lazyValue.get(), 2); | |
} | |
} |
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
system ~/work/jruby master 1109% CLASSPATH=. jruby -e 'p Java::A::square_lazy ->{ 2.0 }' | |
4.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment