Create a Java program to demonstrate interface implementation with lambda expressions
interface Operation { int perform(int a, int b); } public class Main { public static void main(String[] args) { Operation addition = (a, b) -> a + b; Operation subtraction = (a, b) -> a - b; System.out.println("Addition : " + addition.perform(4, 7)); System.out.println("Subtraction : " + subtraction.perform(10, 7)); } }
Addition : 11 Subtraction : 3
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions