What is the difference between ArrayList and HashSet in Java (Core Java Interview Q&A in Telugu #24)

Поділитися
Вставка
  • Опубліковано 5 лип 2024
  • In this session, in Telugu language, I have explained and practically demonstrated the difference between ArrayList and HashSet in Java. ArrayList and HashSet are the pre-defined classes in Java under Collection Framework. ArrayList has indexing concept, where the elements stored into the ArrayList will stored starting with the index 0, in a pre-served order and duplicates will be allowed as they can be differentiated with the index. Hence in ArrayList, the order in which the elements got added to the ArrayList is saved in the same order in the memory. Because of indexing concept in ArrayList, the duplicate elements will be having different indexes, hence duplicate elements will be considered as different elements. We can access the individual elements of the ArrayList using their index using get(index) method. We can use traditional for loop with ArrayList due to its indexing concept. And also the parent interface of ArrayList is List interface. Coming to HashSet, it doesn't have any indexing concept. Duplicates are not allowed in HashSet. Elements will be stored in random order in HashSet. There is not get() command or method to retrieve the elements from the HashSet individually. We cannot use traditional for loop with HashSet. And also the parent interface of HashSet is Set interface. All the above differences between ArrayList and HashSet explained above are demonstrated practically using Java programs in this session.
    What is the difference between ArrayList and HashSet in Java (Core Java Interview Q&A in Telugu #24)
    For any doubts, live training updates, internship program and free Courses, please join our Telegram channel t.me/qafoxoriginal
    View Notes Here - docs.google.com/document/d/18...
    Find all free full courses on Software Testing and Tools here - www.linkedin.com/posts/arunmo...
    Visit our website for more details here - www.qafox.com/

КОМЕНТАРІ • 1

  • @TechFoxTelugu-gx5ev
    @TechFoxTelugu-gx5ev  24 дні тому

    For any doubts, live training updates, internship program and free Courses, please join our Telegram channel t.me/qafoxoriginal