ADVERTISEMENT
ADVERTISEMENT

Java ArrayList Programs

This section contains solved programs on Java ArrayList with output and explanations like, adding element in the list, removing element from the list etc.

List of Java ArrayList Programs

  1. Java program to create an ArrayList, add elements and print
    In this java program, we are going to learn how to create an ArrayList, add elements in the ArrayList and print the elements on the output screen?
  2. Java program to add element at specific index in ArrayList
    In this program, we are going to learn create an ArrayList, adding elements at specific index and print them on output screen.
  3. Java program to add elements in ArrayList and print them in reverse order
    In this program, we are going to create an ArrayList, add elements in the ArrayList and print elements in reverse order.
  4. Java program to remove elements from specific index from an ArrayList
    In this program, we a going to learn to create an ArrayList, adding elements to ArrayList and removing elements from specific index.
  5. Java program to remove all elements from an ArrayList
    In this Java program, we are going to learn how to remove all elements from an ArrayList? Here, we are using ArrayList.clear() to remove all elements.
  6. Java program to create a sub list from an ArrayList
    In this Java program, we are going to learn how to create a sub list from an ArrayList? This example contains a list of some elements and creates a sub list.
  7. Java program to search an element from an ArrayList
    In this java program, we are going to learn how to search an element from an ArrayList? To find an element, we use contains() method of ArrayList class.
  8. Java program to find index of an element from an ArrayList
    In this Java program, we are going to learn how to find an index of an element from an ArrayList? To find an index of an element using ArrayList.indexOf() method.
  9. Java program to replace element within the ArrayList
    In this java program, we are going to learn how to replace element of an ArrayList? Here, we have an ArrayList and replace element of it.
  10. How to extract some of the elements from given list in java?
    Here, we are implementing a java program that will have some elements in the list and we will extract particular elements (from given to index to from index).
  11. Java program to multiply corresponding elements of two lists
    Here, we are implementing a java program that will multiply corresponding elements of two array lists.
ADVERTISEMENT



ADVERTISEMENT



Comments and Discussions


ADVERTISEMENT

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.