Ordenação de arrays Tutorial do GUJ . Duvida

Estou com uma duvida no metodo ----->

{
public int compare( Object obj1, Object obj2 ) {
return ((String)obj1).compareTo((String)obj2);
}

Do tutorial da GUJ. Se eu tenho um metodo que retorna um “int” como posso escrever return ((String)obj1).compareTo((String)obj2). retornando uma String? Obrigado!

codigo completo:

import java.util.*;

public class TesteOrdenacao {

public static void main( String args[] ) {
    String[] nomes = { "Daniel", "Paulo", "Rafael", "Guilherme", "Jonas", "Augusto", "Anderson" };
    listar(nomes);

    Arrays.sort( nomes,
        new Comparator() {
            public int compare( Object obj1, Object obj2 ) {
                return ((String)obj1).compareTo((String)obj2);
            }
        }
    );

    listar( nomes );
}

static void listar( String[] lista ) {
    for(int i=0; i<lista.length; i++) {
        System.out.println( lista[i] );
    }
}

}

Olá,
isso

 return ((String)obj1).compareTo((String)obj2); 

não retorna uma String, retorna um int mesmo…

do site da Sun

[quote]Returns:
the value 0 if the argument string is equal to this string; a value less than 0 if this string is lexicographically less than the string argument; and a value greater than 0 if this string is lexicographically greater than the string argument.[/quote]

http://java.sun.com/j2se/1.4.2/docs/api/index.html