Check if a string is a palindrome.
public class Test {
public static void main(String[] args) {
String str = "jungle";
boolean ans = isPalindrome(str);
if (ans == true) {
System.out.println("Given string is a palindrome");
} else {
...
learnjava.com1 min read
Mehzabin Aothoi
Software Engineer
That's a good approach but have you tried solving it using a Stack?