Java Functional Interface MCQs with answers Page - 1

You will find multiple-choice questions (MCQs) related to #Java Functional Interface here. Go through these questions to prepare effectively for your upcoming exams and interviews.

To view the correct answer for any question, simply click the "Show Answer" button.

Have a question to share? Click on "Add Question" to contribute!

A

Admin • 802.91K Points
Coach

Q. What is a functional interface in Java?

  • (A) An interface with default methods only
  • (B) An interface with exactly one abstract method
  • (C) Any interface with static methods
  • (D) Any abstract class

A

Admin • 802.91K Points
Coach

Q. Which annotation is used to indicate a functional interface?

  • (A) @Override
  • (B) @FunctionalInterface
  • (C) @Deprecated
  • (D) @Interface

A

Admin • 802.91K Points
Coach

Q. Which of the following is a functional interface?

  • (A) Runnable
  • (B) Serializable
  • (C) Comparable
  • (D) Cloneable

A

Admin • 802.91K Points
Coach

Q. Which method is declared by the functional interface `Supplier`?

  • (A) get()
  • (B) accept()
  • (C) test()
  • (D) apply()

A

Admin • 802.91K Points
Coach

Q. What is the purpose of the `Predicate` functional interface?

  • (A) Consume an input and produce a result
  • (B) Test a condition on input and return boolean
  • (C) Supply values with no input
  • (D) Chain multiple consumers

A

Admin • 802.91K Points
Coach

Q. Which method does `Consumer` functional interface define?

  • (A) run()
  • (B) get()
  • (C) accept()
  • (D) apply()

A

Admin • 802.91K Points
Coach

Q. Which functional interface is used when no input is taken but a result is returned?

  • (A) Consumer
  • (B) Supplier
  • (C) Predicate
  • (D) Function

A

Admin • 802.91K Points
Coach

Q. What does the `Function` functional interface do?

  • (A) Consumes a value
  • (B) Produces a boolean
  • (C) Transforms input to output
  • (D) Runs in a new thread

A

Admin • 802.91K Points
Coach

Q. Which functional interface method is defined in `Predicate`?

  • (A) test()
  • (B) apply()
  • (C) accept()
  • (D) run()

A

Admin • 802.91K Points
Coach

Q. Which of these is NOT a standard functional interface in Java?

  • (A) Runnable
  • (B) Callable
  • (C) Cloneable
  • (D) Supplier
What's Tag

As you may know, questions are organized under broad categories. Each category can include various types of questions. For example, the "History" category might contain questions about the Revolt of 1857, Shivaji Maharaj, Ancient History, Buddhism, and more.

To further refine this organization, we've introduced tags, which act as sub-categories to group questions more specifically.

Verified users can add tags to any question. If you have any suggestions regarding this system, we'd love to hear from you. Contact Us

Learn More