For an ArrayList list, which expression returns the number of elements currently stored?
Please select an answer first.
Correct answer: C
The correct answer is list.size().
- Trace the program or computing system: Identify the data, variables, objects, control flow, abstraction, network layer, or social impact described in the question.
- Apply the computer science principle: The size() method returns the current number of elements in an ArrayList.
- Check the result and assumptions: Check types, indexes, order of execution, boundary cases, representation, privacy, reliability, and whether the conclusion follows from the evidence.
The size() method returns the current number of elements in an ArrayList.
