Implementation:
The main difference between ArrayList and HashSet is that ArrayList is the implementation of the List interface while HashSet is the implementation of the Set.Internal implementation
ArrayList uses an array to store its elements.
HashSet uses a hashmap for its implementation.
The order of the elements
ArrayList keeps the order of the elements they are inserted from.
HashSet does not keep the order of the elements.
Duplication
ArrayList allows duplicate values.
HashSet does not allow duplicate values.
Commentaires (0)
Laisser un commentaire
Connectez-vous pour commenter
Rejoignez la discussion et partagez vos connaissances avec la communauté
Chargement des commentaires...