title: ArrayList.add method not working
body: <p>I am a beginner at java and I con't understand why this isn't working. I am trying to write a program that converts a base 10 number to a binary one, but I'm having an issue with an ArrayList. I can't use the add method of the ArrayList:</p>
  
  <pre><code>import java.util.ArrayList;
  import java.util.Scanner;
  
  public class DecimalToBinary {
  public static void main (String[] args){
      Scanner reader = new Scanner (System.in);
  
      System.out.println("This program converts a decimal number to binary.");
  
      int decimal;
      ArrayList&lt;int[]&gt; binary = new ArrayList&lt;int[]&gt;();
  
      //Gets decimal number
      System.out.print("Enter base 10 number: ");
      decimal = reader.nextInt();
  
      //Adds 1 to binary and then adds the remainders of decimal/2 after that until decimal is 1 
      binary.add(1, null);
      while (decimal != 1){
          binary.add(1, decimal%2);//This is where I get the error
          decimal = decimal/2;
      }//Ends While loop
  }//Ends main
  </code></pre>
  
  <p>}//Ends DecimalToBinary class</p>