title: Loop until user input length is less than or equal to previous user input
body: <pre><code>import java.util.Scanner;
  
  public class userInputTest {
  
      public static void main(String[] args) {
  
          Scanner sc = new Scanner(System.in);
  
          for(int i = 0; i&gt;-1; i=i+1){
  
              String[] giveMeAString = new String[i+1];
              String x = sc.next();
  
              giveMeAString[i]=x;
  
              if(i&gt;=0){
                  if (giveMeAString[i].length() &lt; giveMeAString[i-1].length()){
                      System.out.println("The string is shorter than previous string!");
                      break;}
              }
  
          }
  
      }   
  }
  </code></pre>
  
  <p>I want to loop until present user input length is less than previous user input length.</p>
  
  <p>I haven't solved it for a while after many attempta.</p>
  
  <p>what am I doing wrong?
  I want to use Array, because I also want to print the user inputs out later on.</p>
  
  <p>The only problem I have now is to make the written code work.</p>