Q. Which lambda expression counts the length of a string?

  • (A) s -> s.size()
  • (B) s -> s.length()
  • (C) s -> s.count()
  • (D) s -> s.len()
πŸ’¬ Discuss
βœ… Correct Answer: (B) s -> s.length()
Explanation: `s.length()` returns the length of a string in Java.
Explanation by: Mr. Dubey
`s.length()` returns the length of a string in Java.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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