title: How do i print palindrome words in a string?
body: <p>So i decided to print all palindrome words in a string. I didnt use arrays or the method to find palindrome of only 3-character-words.Here is my code,the problem being,it prints out nothing</p>
  
  <pre><code>import java.util.Scanner;
  class Pa{
      public static void main(String[] args){
          Scanner sc = new Scanner (System.in);
          String s=sc.nextLine();
          char b;
          int i,a;
          String st="";/to extract a word
          s=s+" ";
          String t="";/to extract the reverse of the word
          a=s.length();
          for(i=0;i&lt;a;i++){
              b=s.charAt(i);
              if(b!=' '){
                  st=st+b;/word
                  t=b+st;/reversed word
              } else { 
                  if(st.equals(t)){
                      System.out.println(st);
                  }
              st="";
              t="";
              }
          }
      }
  }
  </code></pre>
  
  <p>I cannot figure out what's wrong and would not appreciate the split or 3-word palindrome finder options or the normal even-or-odd only palindrome finding options.</p>