title: Java - Do you want to continue?(Y/N)
body: <p>I want to write a simple loop for the program to go back and restart it again.</p>
  
  <p>Just a simple 1 question program. Then the system ask if the user want to do it again. If the user inputs Y ... the program will loop it back to the beginning and run the entire program again. If the user inputs N, it exits.</p>
  
  <pre><code>import java.util.Scanner; // show them as code
  
  public class HowToDoLoop {
  
  public static void main(String[] args) {
  
      Scanner input = new Scanner(System.in);
  
      System.out.print("How much money do you want to have? ");
      double money = input.nextDouble();
  
      System.out.println("Ok, here is yours $" + money);
  
      System.out.println("Do you want to continue y or n");
  </code></pre>