[Java] 람다식
1. Lamda 표현식 public class SamTest { SamTest(){ Sam s = new Sam(); InterImpl impl = new InterImpl(); s.m1(impl); } public static void main(String[] args) { new SamTest(); } } public class Sam { void m1 (Inter inter) { int res = inter.calc(1, 2); System.out.println(res); } } public class InterImpl implements Inter { @Override public int calc(int a, int b) { return a+b; } } public interface Inter {..
2024.01.28