Domanda di colloquio di Pearson

Palindrome Java question and explain the code lines one by one.