error !!! please ignore approach 1 , fix me approach two , I am trying to make a palindrome checker !!! code in description
import java.util.*; //WRITE A JAVA PROGRAM TO TAKEA WORD AS A INOUT FROM THE USER AND CHECK WHETHER ITS A PALINDROME //words to test : , MOM ,NITIN , POOP, TACOCAT , BOOB , LOOL , ETC...... //APPROACH 1 String str1= new String("BOOB"); String str2 = new String(""); for(int i=str1.length()-1;i>=0;i--){ str2 =str2+str1.charAt(i); } if (str1.length()%2!=0){ if(str1.charAt((str1.length()/2))==str2.charAt((str2.length()/2))){ for(int i =0;i>=str1.length();i++ ){ if(str1.charAt(i)==(str2.length()-1-i)){ System.out.println("Yes its a palindrome"); }else{ System.out.println("NO its not a palindrome "); } } } }else{ for(int i =0;i>=str1.length();i++ ){ if(str1.charAt(i)==(str2.length()-1-i)){ System.out.println("Yes its a palindrome"); }else{ System.out.println("NO its not a palindrome "); } } } } } // status: success -- class palindrome{ public static void main(String args[]){