6 Replies Latest reply on Jul 24, 2013 9:21 AM by PhHein

    ArrayList question - can add String but not int

      I"m a little confused on something with ArrayLists. I'm trying to add an int to the ArrayList
      Suppose I have:

      int myInt = +<some value>+
      String myString = +<some value>+
      ArrayList myAL= new ArrayList(0);

      However, when I compile (using java 1.4.2), I get a compile error for the method add when it's passed an int, so I have to do this instead:


      Is there some way I can store these integer value in my ArrayList as int's without converting them to String?