title: JAVA find largest and smallest word in string
body: <pre><code>    public class maxWord {
      public static void main(String[] args) {
          String str = "“@2434 rfdfd4f fff“";
          System.out.println(maxWord(str));
          System.out.println(minWord(str));
      }
  
      public static String maxWord(String input){
          String[] str = input.split(" ");
          if (str.length==0) return null;
          String longest=" ";
          for (String word:str){
  
              if (word.length()&gt;longest.length()) {
                  longest=word;
  
              }
          }
          return longest;
      }
  
      public static String minWord(String input){
          String[] str = input.split(" ");
          String shortest=" ";
          for (String word:str){
              if (word.length()&lt;shortest.length()) {
                  shortest=word;
  
              }
          }
          return shortest;
      }
  }
  </code></pre>
  
  <p>i have 2 methods here and they are almost similar but minWord doesn't show the smallest word, where is the mistake?</p>
  
  <p>actually don't undestand where is a problem, i hope you will help me</p>