// demonstrate use of ... notation with for:each

void myMethod( String... animals )
   {
   for ( String animal : animals )
      {
      out.println( animal );
      }
   }

// calling myMethod
myMethod( "tiger", "lion", "hippopotamus" );
myMethod( "tiger" );
myMethod( );
String[] someStringArray = getValues();
myMethod( someStringArray );

// In early Java versions, you had to write it out longhand as:
void myOldMethod( String[] animals )
   {
   for ( int i=0; i< animals.length; i++ )
      {
      out.println( animals[i] );
      }
   }

// calling myOldMethod
myOldMethod( new String[] {"tiger", "lion", "hippopotamus"} );
myOldMethod( new String[] {"tiger"} );
myOldMethod( new String[0] );
String[] someStringArray = getValues();
myOldMethod( someStringArray );

// The code does the same thing.