Q. Which of the following lambda expressions is valid for a `Predicate<Integer>`?

  • (A) x -> x > 10
  • (B) (x, y) -> x + y
  • (C) () -> true
  • (D) (x) -> x.length()
πŸ’¬ Discuss
βœ… Correct Answer: (A) x -> x > 10
Explanation: A `Predicate<Integer>` requires a single input and returns a boolean.
Explanation by: Mr. Dubey
A `Predicate<Integer>` requires a single input and returns a boolean.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
71
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
83%
Success Rate