Sun May 26 2024 20:21:22 GMT+0000 (Coordinated Universal Time)
Saved by @prabhas
public class PiLambdaExpression{ @FunctionalInterface interface PiValue{ double getPi(); } public static void main(String[] args) { PiValue pi = () -> Math.PI; double p= pi.getPi(); System.out.println("The value of Pi is: " + p); } }
Copy this HTML code:
Preview:
open_in_newInstructions on embedding in Medium
Comments