Java Lambda Expression MCQs with answers Page - 1

You will find multiple-choice questions (MCQs) related to #Java Lambda Expression 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 • 825.56K Points
Coach

Q. Which Java version introduced Lambda Expressions?

  • (A) Java 6
  • (B) Java 7
  • (C) Java 8
  • (D) Java 9

A

Admin • 825.56K Points
Coach

Q. Which symbol is used in a lambda expression to separate parameters from the body?

  • (A) ->
  • (B) =>
  • (C) ::
  • (D) &&

A

Admin • 825.56K Points
Coach

Q. Which of these is a correct lambda expression syntax in Java?

  • (A) (a, b) -> a + b
  • (B) (a, b): a + b
  • (C) (a, b) => a + b
  • (D) lambda a, b: a + b

A

Admin • 825.56K Points
Coach

Q. Lambda expressions can only be used with:

  • (A) Interfaces with one abstract method
  • (B) All interfaces
  • (C) Abstract classes
  • (D) Enums

A

Admin • 825.56K Points
Coach

Q. What is the type of a lambda expression?

  • (A) Interface
  • (B) Class
  • (C) Functional Interface
  • (D) Abstract Class

A

Admin • 825.56K Points
Coach

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

  • (A) Runnable
  • (B) Callable
  • (C) Comparator
  • (D) Thread

A

Admin • 825.56K Points
Coach

Q. Which keyword is used to define a functional interface?

  • (A) abstract
  • (B) @FunctionalInterface
  • (C) interface
  • (D) final

A

Admin • 825.56K Points
Coach

Q. Which functional interface is used to represent a function that takes one argument and returns a result?

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

A

Admin • 825.56K Points
Coach

Q. Which functional interface represents an operation that takes a single input argument and returns no result?

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

A

Admin • 825.56K Points
Coach

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

  • (A) Supplier
  • (B) Consumer
  • (C) Function
  • (D) Runnable
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