How can a string be checked for the presence of special characters like '.' and '@' in Java? How can I write a program in Java to get the last character of string in a string array & check whether the new string formed is palindrome or not?