/**

*   This is example3 from CS 239 Lab 3 - It provides an example of AVOIDING

*   an array out of bounds error by using the length attribute of an array

*   to avoid going past the last element in the array.

*

*   @author David Bernstein - modified by Elizabeth Adams

*   date:  September 1, 2008

*/

 

   public class Example3_Key

   {

      public static void main(String[] args)

      {

         int        i;

                 

              // the one example where declaration & initialization

              // in a single step are allowed in this course

         int[]      data = {50, 320, 97, 12, 2000};

     

     

         for (i=0; i < data.length; i++)

         {

           System.out.println(data[i]);

         }  // end for

         System.out.println("Done");

 

      } // end main

   } // end class