Home Tutorial Java Collections Arraylist arraylist size in the Java program

 
 

arraylist size in the Java program
Posted on: October 23, 2009 at 12:00 AM
This section demonstrates the How to use of size() function in the java ArrayList.

  • size() function gives  the total number of elements present in
    the arrayList.


Example of Java Arraylist Size() Function
import java.util.ArrayList;
import java.util.List;

public class List1 {
    public static void main(String[] args) {
        float fr[]={33.4f,66.78f,77.8f};
      List list=new ArrayList();
         for (float f:fr) {
         list.add(f);
        }
         for(int x=0;x







					
					

Related Tags for arraylist size in the Java program:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.