This post originated from an RSS feed registered with Java Buzz
by Arpit Mandliya.
Original Post: How to find length/size of Arraylist in java
Feed Title: Java tutorial for beginners
Feed URL: http://feeds.feedburner.com/arpitmandliyasblog
Feed Description: A blog about java programming language and its frameworks
In this tutorial, we will see how to find length/size of Arraylist in java. You can use ArrayList’size() method to calculate size of ArrayList. Let’s understand it with the help of Simple example. When you run above program, you will get below output: Size of Country List is: 4 Size of Country List is: 2 As you can see here, size of ArrayList was 4, then we removed two elements from it and size of ArrayList became two. That’s how you can find length/size of ArrayList in java.