Page 25 - Abstract Class, Interface & Struktur Data
P. 25

Java ArrayList











             •        The ArrayList class is a resizable array, which can be found in the




                      java.util package.




             •        The difference between a built-in array and an ArrayList in Javais





                      that the size of an array cannot be modified (if you want to add or



                      remove elements to/from an array, you have to create a new one).




                      While elements can be added and removed from an ArrayList




                      whenever you want. The syntax is also slightly different:
   20   21   22   23   24   25   26   27   28   29   30