r/learnjava • • Oct 25 '22

What does this method really do

I have always used this code and I am not sure what it really does especially dealing with the o

public int compareTo(BasketballPlayer o) {

return averagePPG - this.averagePPG;

}

What does the o mean in the code. I know its a method but I do not know how it is different from the a normal method thats like

public int compareTo() {

return averagePPG - this.averagePPG;

}

0 Upvotes

3 comments sorted by

View all comments

2

u/Pedantic_Phoenix Oct 25 '22

Its a parameter, you really need to study that if you dont know what it is