This document provides instructions for completing 5 collections practical exercises using Java:
1. Compare two strings using == and .equals() and override equals() in a Person class.
2. Create a Person class with name and height, create objects, and override equals() and toString() to correctly compare objects and print references.
3. Add strings to an ArrayList and test adding, searching, removing, size, iteration, and printing. Then test a LinkedList and HashSet.
4. Add Person objects to an ArrayList and verify addition, search and removal works as expected by overriding equals() in Person.
5. Create Address and Employee classes with equals(), create employee objects, and verify objects are
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
57 views
Uttara Infosolutions: Collections Practicals 1
This document provides instructions for completing 5 collections practical exercises using Java:
1. Compare two strings using == and .equals() and override equals() in a Person class.
2. Create a Person class with name and height, create objects, and override equals() and toString() to correctly compare objects and print references.
3. Add strings to an ArrayList and test adding, searching, removing, size, iteration, and printing. Then test a LinkedList and HashSet.
4. Add Person objects to an ArrayList and verify addition, search and removal works as expected by overriding equals() in Person.
5. Create Address and Employee classes with equals(), create employee objects, and verify objects are