Zebra0.com

alice arraysArrays: Ready, Set, Go!

Arrays: Ready, Set, Go!

Tortoise says "Ready", "Set", "Go" using array


Download the Alice project: array-ready.a3p

public void myFirstMethod() {
    String[] sayings = new String[] { "Ready", "Set", "Go"} ;
    for( Integer indexA = 0; indexA<sayings.length; indexA++ ) {
        this.tortoise.say( sayings[i] );
    }
    
    for( String word : sayings ) { 
       this.tortoise.say( word ); 
    }
} 

NEXT: An array of animals