We have provided a Selenium with Java program below to check whether the given string is a palindrome. One statement has been intentionally removed from the code. Identify the missing statement required for the palindrome check to work correctly and share your comments. You can view the solution by clicking the Click for Solution button below.
import org.testng.annotations.Test;
public class SampleProgram6 {
@Test
public void testMySkills() {
String str = "Hello";
if(checkPolindrome(str)){
System.out.println(str+" is a polindrome");
}
else{
System.out.println(str+" is not a polindrome");
}
}
public Boolean checkPolindrome(String str) {
int start = 0;
int len = str.length();
int end = len-1;
while(start<=end) {
if(str.charAt(start) != str.charAt(end)){
return false;
}
start++;
}
return true;
}
}