public void trimToSize()
Trims the capacity of this ArrayList instance to be the list's current size. An application can use this operation to minimize the storage of an ArrayList instance.
ensureCapacity
public void ensureCapacity(int minCapacity)
Increases the capacity of this ArrayList instance, if necessary, to ensure that it can hold at least the number of elements specified by the minimum capacity argument.
Parameters:
minCapacity - the desired minimum capacity
size
public int size()
Returns the number of elements in this list.
Specified by:
size in interface Collection
Specified by:
size in interface List
Specified by:
size in class AbstractCollection
Returns:
the number of elements in this list
isEmpty
public boolean isEmpty()
Returns true if this list contains no elements.
In questa pagina del sito puoi guardare il video online Java ArrayList Methods della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Learning Point By Engineers 17 febbraio 2024, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 71 volte e gli è piaciuto 11 spettatori. Buona visione!