Nth Even length Palindrome | Java program to find nth even length Palindrome ; Function to find nth even length Palindrome ; string r to store resultant palindrome . Initialize same as s ; In this loop string r stores reverse of string s after the string s in consecutive manner ; Driver code ; Function call
import java . io . * ; class GFG { static String evenlength ( String n ) { String res = n ; for ( int j = n . length ( ) - 1 ; j >= 0 ; -- j ) res += n . charAt ( j ) ; return res ; } public static void main ( String [ ] args ) { String n = "10" ; System . out . println ( evenlength ( n ) ) ; } }