swaraj gupta wrote:Christophe Verré and Deepak Bala thanks for your replies !!
1> I got from here that the Strings objects were compared. And as the String class already implements the Comparable interface, we can use the compareTo() method over its objects directly. Am i right... ?
Yep
swaraj gupta wrote:
2> What will happen internally when line #12 will be executed, I mean to say how the control will flow and which line will do what until the call returns?
The code flow would depend on Arrays.sort()'s internal implementation. Your ResortComparator will be called at sometime during the sorting process. The how, when, why of it is transparent to the caller.