java - Explaination on CompareTo method for generics -
I have created a generic class with a type of variable, which implements java.lang. Because I'm having problems with implementing the () method because & lt ;, operators are not valid for normal type use. I came to it. After the accepted answer I was able to apply the method to compare, but I do not understand how it works, please someone can explain .... the answer I was talking about ... Public square DoubleKey & lt; K extends widely & lt; K & gt ;, J extends & lt; J & gt; & Gt; Applies Comparable & lt; DoubleKey & lt; K, J & gt; & Gt; {Key of private 1; Private J key 2; Public Double Key (key 1, J key 2) {this.key1 = key1; This.key2 = key2; } Public Kashmir Festke () {this .key1; } Public J Late Secondhand () {return.key2; } Compare public intervals (Double key The answer code you mentioned is correct I'll explain the code to you in a broad way. First of all, let's check the definition. Public Class Double...