getOrDefault can simplify word-count logic.

Practice this question from Quiz: Sorting and String Checks, with options and an explanation.

Question

getOrDefault can simplify word-count logic.

Option A — Correct answer

True

getOrDefault avoids a separate containsKey check.

Option B

False

getOrDefault avoids a separate containsKey check.

Quiz: Sorting and String Checks

All questions · Previous question · Next question

Open on QuizMaker