Pregunta de entrevista de Pearson

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