Java OCA OCP Practice Question 2180

Question

Which one of the following abstract methods does not take any argument but returns a value?.

  • A. the accept() method in java.util.function.Consumer<T> interface
  • B. the get() method in java.util.function.Supplier<T> interface
  • C. the test() method in java.util.function.Predicate<T> interface
  • d. the apply() method in java.util.function.Function<T, R> interface


B.

Note

The signature of get() method in java.util.function.Supplier<T> interface is: T get().




PreviousNext

Related