Home Tutorial Java Collections Arraylist arraylist size in the Java program

 
 

Share on Google+Share on Google+
arraylist size in the Java program
Posted on: October 23, 2009 at 12:00 AM
Advertisement
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







					
					
Advertisement

Related Tags for arraylist size in the Java program:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: October 23, 2009

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com