title: While Loop and Exiting of While Loop
body: <pre><code>import java.io.*; import java.util.*;
  public class Test{
  public static void main(String args[]){
      while(true)
      {
          Scanner kbReader=new Scanner(System.in);
          System.out.println("Whats your name?");
          String s=kbReader.nextLine();
          String at=s.substring(0,1);
          if(at.equalsIgnoreCase("t"))
          {
              System.out.println("You're AWESOME!!!");
          }
          else
          {
              System.out.println("You suck");
          }
      }
  }
  }
  </code></pre>
  
  <p>My code is a simple input code that asks to enter your name and looks at the first letter only and runs that through an if statement. Im using a while loop to loop the code endlessly. How would i have a line of code that would ask the person imputing Strings if they want to quit the while loop or not?</p>