Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java

How do collections.sort or array.sort know how to find and apply the appropriate comparable or comparator interface?

I mean how do they link up or wire together. I've never understood this and I think I've had a similar question when I was going through the C# course on Treehouse. Now I obviously don't mean to ask this question when sort takes an anonymous class or some other parameter that provides the needed CompareTo or Compare method directly. I've tried looking at API pages but that was above my knowledge level.