Answer:
Following are the program in the Java Programming Language.
//define function
public static boolean checkPalindrome(String str){
//set integer variable to 0
int a = 0;
//set integer variable to store the length of the string
int n = str.length() - 1;
//set the while loop to check the variable a is less than the variable n
while(a<n)
{
//check the string character is not in the variable n
if(str.charAt(a)!= str.charAt(n))
//then, return false
return false;
//the variable a is incremented by 1
a++;
//the variable n is decremented by 1
n--;
}
//and return true
return true;
}
Explanation:
Following are the description of the following function.