'There is a method to dinamically change the size of array in java

I'm a beginner with java and I wanted to know if there was a way to dynamically instantiate an array, that is, being able to add and remove elements by changing the actual size of the array.



Solution 1:[1]

Try Arraylist: https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html

List<String> list = new ArrayList<>();

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1