I need help to figure out how to implement a common getter method. Here is the code that I still have:
public class Pair<X extends Comparable<X>, Y extends Comparable<Y>> implements Comparable<Pair<X, Y>>{ private final X first; private final Y second; public GENERIC getX() { return X; } public GENERIC getY() { return Y; }
Can someone explain to me how to replace GENERIC with some type of returned object <A extends classA> A for this class? I have seen examples of other methods with common return values, but I donโt understand how to apply them here. Thanks!
source share