Q. Which lambda expression can be used to check if a string is empty?

  • (A) s -> s.isEmpty()
  • (B) () -> isEmpty()
  • (C) s => s.empty()
  • (D) s -> s.size() == 0
πŸ’¬ Discuss
βœ… Correct Answer: (A) s -> s.isEmpty()
Explanation: The `isEmpty()` method checks for an empty string.
Explanation by: Mr. Dubey
The `isEmpty()` method checks for an empty string.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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