Question: A Trio is a class representing a data structure that holds a group of three items. - Modify the class header to make it a

A Trio is a class representing a data structure that holds a group of three items. - Modify the class header to make it a generic class (check the slides on Pair class for hints): 5pts - Instance data variables: 5pt - Constructors: two overloaded constructors. (10pts) * one takes three different items * one takes one item for all 3 instance data variables - 3 getters, each accessing one instance data variable: 5pts - 3 setters, each setting one instance data variable: 5pts - a toString method that returns a text representation of the trio: each item should be included (5pts) - an equals method: Note that for two trios to be logically equivalent they need to have the same three items, not necessarily in the same order. (20pts) - a method called hasDuplicates that returns true if at least two items within the Trio are the same as each other (15pts) - a count method that takes in an item and returns a count of how many times that item is in the Trio (15pts) a replaceAll method that takes in one item as a parameter and modifies the current Trio so that it holds three of that item ( 15pts )
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
