Sun Jun 09 2024 09:07:15 GMT+0000 (Coordinated Universal Time)
Saved by @login
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