• Skip to main content
  • Skip to primary sidebar

Founder at work

Master the skills to create and launch your next SaaS company

  • About Me
  • Reviews
  • Resources
  • Community
  • Contact
  • Lessons
  • Series
  • Search
  • Login

How to work with a list of arrays?

November 7, 2012 by Rick Hernandez Leave a Comment

A list of an array is created when you explicit know the size of the array and the values that would go inside the array for example

 int [] iList = {5,10,15,20,25};

The first part of this array list declares the type of array list in the example it was an int, next is the brackets [] this just tells java that i want to create an array, next we give it a name i called it “iList” next is the assignment operator = with the list of numbers that i want to store in iList array, in this list array i have created five slots in the array list to store my five numbers here is an example of working with array list.

                   /**** Working with list *******/
    int [] iList = {5,10,15,20,25}; // creates the type and size of list
    
    for (int i=0; i < iList.length; i++) // initilize the list with the for loop
    { 
      //System.out.println(iList[i]); // prints out what is  int he iList arary 
    }

REMEMBER: you don't have to import an array class for you to be able to use arrays in java.

Rick Hernandez

I always had a passion for the field of STEM (Science, Technology, Engineering, and Math) and I knew I wanted to do something to make a difference in the world. I just didn’t know where to start. I was an immigrant in a new country, grew up in a tough environment, and wasn’t sure how… Read More

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)

Related

Filed Under: Java, Programming

Primary Sidebar

Learn How To Take Your Idea And Convert It Into An App From Scratch Even If You Have Never Written A Single Line Of Code.

  • How to Find Your Next Great App Idea
  • The Secret To Getting PAID To Build Your Own App
  • How To Create Your App (SaaS, Mobile, VR, AR, Game)
  • How To Monetize Your Apps
Learn More
4.82 Ratings

Copyright © 2025 · JSecademy Blog Theme on Genesis Framework · WordPress · Log in