import java.util.*;
interface Value{
public Double pi();
}
public class LambdaPI{
public static void main(String args[]){
Value pi = ()-> {
return 3.14;
};
System.out.print("PI value: "+pi.pi());
}
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter