committed by
Quincy Larson
parent
c31aa711d6
commit
2379d56b38
@@ -26,7 +26,12 @@ Since ArrayList implements *List*, an ArrayList can be created using the followi
|
||||
List<Integer> students = new ArrayList<>();
|
||||
```
|
||||
|
||||
An ArrayList is dynamic, meaning it will grow in size if required and similarly shrink in size if elements are deleted from it. This is what makes it better to use than normal arrays.
|
||||
An ArrayList is dynamic, meaning it will grow in size if required and similarly shrink in size if elements are deleted from it. This is what makes it better to use than normal arrays.
|
||||
|
||||
To clear/delete all elements from ArrayList
|
||||
```java
|
||||
variable.clear();
|
||||
```
|
||||
|
||||
we can delete existing element from the list
|
||||
```java
|
||||
|
Reference in New Issue
Block a user