Comparing two simple distance calculating algorithms Is the single method printMaxDistance_a or the two methods printMaxDistance_b AND printMaxDistance_c better or respectively "more readable"? Thanks.

public static void printMaxDistance_a(String s) {
    int first = 0;
    int second = 0;
    int max = 0;
    for (int i = 0; i &lt; s.length(); i++) {
        for (int j = i + 1; j &lt; s.length(); j++) {
            if (s.charAt(i) == s.charAt(j)) {
                if ((j - i) &gt; max) {
                    first = i;
                    second = j;
                    max = j - i;
                }
                break;
            }
        }
    }
    System.out.println(first + " " + second + " " + max);
}

public static void printMaxDistance_b(String s) {
    int first = 0;
    int second = 0;
    int max = 0;
    for (int i = 0; i &lt; s.length(); i++) {
        int cur = printMaxDistance_c(s, s.charAt(i), i + 1);
        if (cur &gt; max) {
            first = i;
            second = i + cur;
            max = cur;
        }
    }
    System.out.println(first + " " + second + " " + max);
}

public static int printMaxDistance_c(String s, char c, int j) {
    for (int i = j; i &lt; s.length(); i++) {
        if (c == s.charAt(i)) {
            return i - (j - 1);
        }
    }
    return 0;
}

@SuppressWarnings("resource")
public static void main(String[] args) {
    String s = new Scanner(System.in).nextLine();
    printMaxDistance_a(s);
    printMaxDistance_b(s);
}
Not more readable with those method names, but in general it is better to split method into more, especially when code is nested like this. I would even go further and split into more than just 2 methods.

But try to name methods so that name clearly says, what method does.

Edit: 

Some ideas of what I would change (starting right from _b and _c methods).


You probably know, that names should be "camelcase", use no underscores and you added underscore just to quickly separate those.
Method is calculating data and printing them. Those are 2 things at once. What if you wanted to use data instead of printing them? what if you wanted to write them to file or return as part of http response? 


At first I would at least return String instead of printing it. Then you can do more things than just printing it. That would require renaming method as it doesn't print anymore. 
That solution is still not ideal, because you are calculating 3 int numbers and instead you are returning String.
Instead you could create immutable class maybe called MaxStringDistance to contain those 3 numbers and instead of returning String, you return something like new MaxStringDistance(first, second, max). 
Now you are missing String representation, that you previously wanted. One way would be to override toString of your new class so that you can then just print that object to get same results as original code or create another method, that will construct the String (I think within that object is best place for it).
You can argue, that method is now "constructing" your MaxStringDistance object. Then it makes sense to put this static method inside MaxStringDistance method as "factory method". Not sure about the name.
Parameter name "s" is short and not very descriptive, try to name variables so that it clearly states what does it contain. It's true, that in this case there's not much to say about it.


That is what I'd do regarding refactoring _b method just based on it's name and signature.


Now let's take a look at _c


This method is definitely not printing anything, but returning int. This one really needs renaming, probably something like calcualteCharDistance
Again single character parameters. I'd at least rename "j" to "position" because it seems like it represents character position in the string (+1 so that's why "position", not "index")
You probably won't be calling this method from anywhere else and can be set it's visibility to private.


Somewhat improved code will look like this:

public class MaxStringDistance {
    private final int first;
    private final int second;
    private final int max;

    //possibly private constructor
    public MaxStringDistance(int first, int second, int max) {
        this.first = first;
        this.second = second;
        this.max = max;
    }

    //getters if needed

    @Override
    public String toString() {
        return first + " " + second + " " + max;
    }

    public static MaxStringDistance fromString(String s) {
        int first = 0;
        int second = 0;
        int max = 0;
        for (int i = 0; i &lt; s.length(); i++) {
            int cur = calculateCharDistance(s, s.charAt(i), i + 1);
            if (cur &gt; max) {
                first = i;
                second = i + cur;
                max = cur;
            }
        }
        return new MaxStringDistance(first, second, max);
    }

    private static int calculateCharDistance(String s, char c, int position) {
        for (int i = position; i &lt; s.length(); i++) {
            if (c == s.charAt(i)) {
                return i - (position - 1);
            }
        }
        return 0;
    }

    public static void main(String[] args) {
        String userInput = new Scanner(System.in).nextLine();
        System.out.println(MaxStringDistance.fromString(userInput));
    }
}