Question: BabyName class Specifications You will create a class called BabyName that contains the instance variables, name, and number. This class must contain the following methods:

 BabyName class Specifications You will create a class called BabyName that
contains the instance variables, name, and number. This class must contain the

BabyName class Specifications You will create a class called BabyName that contains the instance variables, name, and number. This class must contain the following methods: equals - Create a standard equals method. It is this equals method that the ArrayList uses to determine if a name is already in the list. Remember NO duplicates! If a name is already in the list, you will simply access the BabyName object for that name and add to the number the number of additional babies with that name. compare To- The BabyName class must implement the Comparable Interface. It is the comparable interface method compare To that you will use to sort the ArrayLists in descending order. Look at the number field in the BabyName. Base your logic on that first. If you are comparing two BabyNames with the same numbers, then use the Name to decide which goes first, alphabetical order toString - You know every class that you intend to print out needs one. Make sure you output the name and number for the baby name BabyNameStats Class Specifications Two private ArrayLists of BabyName. One for males and one for females. Have the constructor null out these fields A public Constructor that takes 3 int values .Start Year .End Year Number of Top Names desired. and saves these values as fields. Error checking these values would be appropriate. If bad values were passed, throw an exception

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!