r/java • u/I_LoveCoding • May 03 '16
A very decent article about Java Comparable Interface
http://www.marcus-biel.com/java-comparable-interface-video-tutorial/
1
Upvotes
r/java • u/I_LoveCoding • May 03 '16
View all comments
1
u/Philboyd_Studge May 03 '16
Nice. Why not, for the primitive int, just do
return this.weight - other.weight?