O Main.java Write code that will take in a String input and check to see if it is a palindrome or not. 3 Main.java 1 imp
Posted: Sat May 14, 2022 6:34 pm
O Main.java Write code that will take in a String input and check to see if it is a palindrome or not. 3 Main.java 1 import java.util.Scanner; 2 class Main public static void main(String[] args) { Scanner inp = new Scanner(System.in); System.out.print("In:"); String s = inp.nextLine(); 8 //write your code below 3 4 A palindrome means that the characters are the same forwards and backwards, ignoring spaces. 5 6 7 Examples of palindromes: 9 racecar was it a car or a cat I saw 10 11 12 } never odd or even } • rats live on no evil star 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. -