Method references and their lambdas
QuizEasy-MediumJava onlyAsked in: Tech Mahindra
Which pairs are equivalent? Pick all that apply.
Function<String, Integer> f = String::length;ands -> s.length()Consumer<String> c = System.out::println;ands -> System.out.println(s)Supplier<List<String>> s = ArrayList::new;and() -> new ArrayList<>()Predicate<String> p = String::isEmpty;ands -> s.length() > 0
This question is part of Pro+
Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.