Question: public class DefaultIntPair implements IntPair { private int firstNum, secondNum; public DefaultIntPair(int firstNum, int secondNum) { this.firstNum = firstNum; this.secondNum = secondNum; } public int

public class DefaultIntPair implements IntPair { private int firstNum, secondNum; public DefaultIntPair(int firstNum, int secondNum) { this.firstNum = firstNum; this.secondNum = secondNum; } public int first() { return firstNum; } public int second() { return secondNum; } public String toString() { return ""; } public boolean equals(Object o) { if (this == o) return true; if (o == null) return false; DefaultIntPair intPair = (DefaultIntPair) o; return firstNum == intPair.firstNum && secondNum == intPair.secondNum; } public IntPair reverse() { DefaultIntPair reversedPair = new DefaultIntPair(secondNum, firstNum); return reversedPair; } }d) 1 Redefine pands from the test fragment aboveusing the new generic typesPair and DefaultPair (the generic version of DefaultIntPair). (Do not show the rest of the test codel)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
