Question: It's in Java 13 pts) For this problem you will be implementing part of a class call Pair. Each object of the class will need

 It's in Java 13 pts) For this problem you will be

It's in Java

13 pts) For this problem you will be implementing part of a class call Pair. Each object of the class will need to hold two integers (name them first, second) that are not accessible outside the class and cannot be changed after the object has been constructed. The object will also need to have a static integer (name it counter) that is used as a counter of how many Pair objects have ever been created. You need to: 20. ( a. Fill in the top of the class definition so that the integer fields described above exist for the class. b. Implement a constructor that takes two integers and assigns them to first and second. c. Implement an instance method called equals (Pair) that takes another Pair object as a 0 parameter and returns true if and only if the first and second fields of the current object are the same as the corresponding fields in the object sent as the parameter. d. Implement an instance method called cloneMe0 that returns a brand new Pair object which contains the same information as the one that invoked the method. Implement a static method called count0 that returns the number of Pair objects that have been created. e. public class Pair f //Declare any required instance and static fields up here

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!