Page 1 of 1

Write code that will take in a String input and check to see if it is a palindrome or not. A palindrome means that the c

Posted: Sat May 14, 2022 4:51 pm
by answerhappygod
Write code that will take in a String input and check to see if
it is a palindrome or not.
A palindrome means that the characters are the same forwards and
backwards, ignoring spaces.
Examples of palindromes:
Your check should be case insensitive too. For example, "Bob" is
a palindrome, despite the first B being capitalized.
Your program will print out "true" if it's a palindrome and
"false" if not.
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner inp = new Scanner(System.in);
System.out.print("In:");
String s = inp.nextLine();
//write your code below
}
}