CJCoding With Joseph
15free / daySign inCreate account

Thompson Rivers University

Module 4 Lab 4: Collections

Lab 4 Collections - SM 2025

In this lab, you’ll work with Java generics and basic array utilities to understand how collections can store and manipulate data. Specifically, you will:

  • Learn how to use a generic Pair class to store two related values

  • Modify that Pair so both values share the same type

  • Add a method to swap the two stored values

  • Explore built-in methods in java.util.Arrays to create, copy, sort, and search arrays

These exercises build foundational skills for working with Java collections—knowing how to define and use generic classes, and using helper methods to manage arrays efficiently. You don’t need to open the PDF to begin: each question below explains what you must do, why it matters, and how to approach it step by step.

Members only

Keep reading this lesson

You've reached the end of the free preview. Unlock the rest of this lesson plus 54 more lessons in Thompson Rivers University.

  • Unlimited coding questions
  • Unlimited access to all classroom material
  • Weekly live call for questions and guidance
  • 3,000 AI tutor tokens / month
  • Personal SQL database (3 MB)
  • Progress tracking

Cancel any time.