자바 메서드 레퍼런스1 Java - 메서드 레퍼런스(method reference) 하나의 메서드만 호출하는 람다식은 ‘메서드 레퍼런스’로 간단히 할 수 있다. 1. 정적 메서드 레퍼런스 //패턴 (args) -> ClassName.staticMethod(args) ClassName::staticMethod Function f = (String s) -> Integer.parseInt(s); Function f = Integer::parseInt; // 메서드 레퍼런스 2. 인스턴스 메서드 레퍼런스 (arg0, rest) -> arg0.instanceMethod(rest) ClassName::instanceMethod BiFunction f = (s1, s2) -> s1.equals(s2); BiFunction f = String::equals; 3. 특정 객체의 인스턴스 메서드 레퍼런.. 2017. 3. 10. 이전 1 다음