Method Reference MCQs with answers
78 questions tagged Method Reference, each with the correct answer and an explanation. Page 4 of 4.
- What kind of method reference is used in `objectName::methodName`?
- Which interface is often used with a constructor reference like `ArrayList::new`?
- What is the method reference equivalent of `() -> ClassName.staticMethod()`?
- Can method references replace lambda expressions?
- What kind of method reference is `Thread::new`?
- Which of the following is NOT a valid method reference form?
- What is the equivalent method reference for `(x, y) -> Integer.compare(x, y)`?
- Method references can be used in combination with which Java feature?
- Which type of method reference is represented by `Object::toString`?
- Which method reference matches a lambda expression like `s -> s.toLowerCase()`?
- Which functional interface is often used with method references that return a value?
- What does the method reference `this::methodName` refer to?
- What type of method reference is `Math::abs`?
- What does `ClassName::new` represent in Java?
- Which method reference type is demonstrated by `System.out::println`?
- What is the purpose of a method reference in Java?
- Which type of method reference is demonstrated by `String::toUpperCase`?
- Which operator is used for method references in Java?