Largest palindrome in a string
Two minor points on the code and one on unit test:


Combining if clauses

You can combine both if clauses as such:

if (isPalindrome(current) &amp;&amp; current.length() &gt; palindrome.length()) { ... }

Enhancing use of for loop

Multiple local variables can be declared in the for loop, so you can include your last variable as such:

private static boolean isPalindrome(String s) {
    for (int i = 0, last = s.length() - 1; i &lt; s.length() / 2; i++, last--) {
        if (s.charAt(i) != s.charAt(last)) {
            return false;
        }
    }
    return true;
}

Unit testing

As mentioned in my comment, it will be better to turn your main() code into a series of unit tests to ensure your logic is working correctly. The example below uses TestNG and Hamcrest matchers, and is meant to be a simple showcase for how this can be done. You should consider a variety of tests (e.g. empty Strings, non-palindromic inputs) to also ensure it works for as many cases as possible. That is when you can consider some of the features of TestNG such as parameterized testing.

@Test
public void doTest() {
    assertThat(findLongestPalindrome("xyzracecar"), equalTo("racecar"));
    assertThat(findLongestPalindrome("abcexcbaddd"), equalTo("ddd"));
    assertThat(findLongestPalindrome("cacxx"), equalTo("cac"));
}



Bonus: Oh yeah, is it the largest or longest palindrome you are looking for? Since you are dealing with Strings, my suggestion is to be consistent and stick with permutations of 'longest palindrome'. :)