πŸ“Š JAVA
Q. In the real-world, which method reference helps when sorting a list of strings alphabetically?
  • (A) String::length
  • (B) String::compareTo
  • (C) String::toLowerCase
  • (D) String::isEmpty
πŸ’¬ Discuss
βœ… Correct Answer: (B) String::compareTo

Explanation: `String::compareTo` is used for natural ordering of strings.

Explanation by: Mr. Dubey
`String::compareTo` is used for natural ordering of strings.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
43
Total Visits
πŸ“½οΈ
8 mo ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
96%
Success Rate