Types
Strings
Substrings
- The
substring
method returns a subset of a String. - Can either be provided a single int parameter or two int parameters.
- The substring begins (inclusively) with the character at the index specified in the first parameter and returns a new String from that point forward.
- If a second parameter is provided, the substrings extends (exclusively) to that index.
- Range must be within bounds of index.
ArrayList
Return | Method | Description |
---|---|---|
boolean | add(E e) |
Appends element to end of list. |
boolean | add(int index, E e) |
Inserts element at specified position in list. |
void | clear() |
Removes all elements from the list. |
boolean | contains(Object o) |
Returns true is the list contains the item. |
E | get(int index) |
Returns element at specified position in list. |
int | size() |
Returns number of elements in list. |