Why am I getting index out of bounds exception?
I've made this code to convert whole base 10 numbers into binary. The code I believe is everything that it needs to be but I can't get me ArrayLists to work. I've spent a few hours on this site and other trying countless changes to no avail. I've gotten the code to compile without and errors but as soon as I enter an int the program crashes. Here is the code: import java.util.Scanner; import java.util.ArrayList; public class BinaryConverter { public static void main(String[] args) { Scanner in = new Scanner(System.in); ArrayList<Integer> binary = new ArrayList<Integer>(); int a = in.nextInt();