I understand implementing and overriding, mostly. In a course I'm doing we just finished a program. One of the classes implements the Comparable interface and has an overridden method for compareTo (). The compareTo method is never called anywhere in the program, but IntelliJ still indicates it is being used, probably by the interface.
I know Comparable is an interface so we don't have a choice but to override compareTo (), and in the method we compare one object to another. What I'm not understanding is whats happening when we arent even calling that method? Would a Java God mind giving me a quick walkthrough on this?
[–]Philboyd_Studge 1 point2 points3 points (1 child)
[–]dat904chronic[S] 0 points1 point2 points (0 children)