I am a java newbie and I am trying to understand the code given here.
What I fail to understand is that in that class StringLengthComparator, they form the "skeleton" to compare 2 objects: String o1, String o2.
When they apply the class however, there are 6 strings which are passed to StringLengthComparator and it yields the correct result.
My question is how come when only 2 objects are compared in the class, but when 6 strings are passed it yields the right result?
Obviously, I am missing something fundamental here, and therefore, any guidance on this would be great.