title: Why doesn't my java code print out the array list?
body: <pre><code>package booking;
  
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.Scanner;
  
  public class CarProfile {
  
      static int year;
      static int cylinders;
      static int plateNum;
  
      public static void main(String[] args) {
          int reg = 1;
          ArrayList &lt;CarProfile&gt; list = new ArrayList &lt;CarProfile&gt;();
  
          @SuppressWarnings("resource")
          Scanner sc = new Scanner(System.in);
  
          while(reg == 1) {                   
              System.out.println("Enter manf. year");
              year = sc.nextInt();
              System.out.println("Enter num. of cyl");
              cylinders = sc.nextInt();
              System.out.println("Enter plateNum");
              plateNum = sc.nextInt();
              System.out.println("If you wish to register another car press 1, otherwise press anything");
              reg = sc.nextInt(); 
          }
  
          Arrays.toString(list.toArray());    
      }
  }
  </code></pre>
  
  <p>This is the code. I also tried to use a for loop with System but didn't get any luck there either. So what am I missing here?
  I don't know what else to type, it is a really simple question.</p>