Home / Report Question

Q. Which of the following Stream operations is most suitable for counting elements matching a condition?
  • A. count()
  • B. size()
  • C. sum()
  • D. collect()