ArrayLists

Description

Information Technology Mind Map on ArrayLists, created by Eithne O'Sullivan on 20/02/2018.
Eithne O'Sullivan
Mind Map by Eithne O'Sullivan, updated more than 1 year ago
Eithne O'Sullivan
Created by Eithne O'Sullivan almost 7 years ago
14
0

Resource summary

ArrayLists
  1. Resizable-array implementation of the List interface.
    1. is an abstraction from programmer manipuplation of Arrays
      1. part of Collections API
      2. Implements all optional List operations
        1. elements can be any object type and null
          1. uses generics<T>
          2. create new ArrayList object
            1. ArrayList<String> list = new ArrayList<String>()
              1. deafault size at creation is 10. can specify required size as constructor parameter
                1. specify class name of objects it will hold in <>. can use empty <> after new.
                  1. Array is used as underlying hidden data structure
                  2. size increases automatically if add to full arraylist
                    1. METHODS
                      1. size: number of indices with elements
                        1. int x = list.size()
                        2. remove element
                          1. remove & return element at index i : E elem=list.remove(i);
                            1. remove 1st match of element e: boolean b = list.remove(e);
                              1. remove all elements: list.clear();
                              2. add element
                                1. add element at end: list.add("something")
                                  1. insert at position of index: list.add(i, elem)
                                  2. replace element: list.set(index, "something else");
                                    1. get element at index i: E e= list.get(i);
                                      1. list.contains(e)
                                        1. list.isEmpty();
                                        2. for-each or enhanced for loop can be used
                                          1. ArrayList vs Array
                                            1. AL: less efficient; not have convenient[ i] use; base type must be a class, not primitive(can use wrappers);
                                              1. A: can't change in size - AL grow/shrink during use; A: need to keep cnt of elements in it- AL: does this auto; A: have NO methods - AL: powerful methods for manipulation
                                              Show full summary Hide full summary

                                              Similar

                                              CCNA Security 210-260 IINS - Exam 3
                                              Mike M
                                              Application of technology in learning
                                              Jeff Wall
                                              Innovative Uses of Technology
                                              John Marttila
                                              Ch1 - The nature of IT Projects
                                              mauricio5509
                                              The Internet
                                              Gee_0599
                                              CCNA Answers – CCNA Exam
                                              Abdul Demir
                                              SQL Quiz
                                              R M
                                              Professional, Legal, and Ethical Issues in Information Security
                                              mfundo.falteni
                                              System Analysis
                                              R A
                                              Flash Cards Networks
                                              JJ Pro Wrestler
                                              EDUC260- Multimodal Literacies for a Digital Age
                                              angelwoo2002