Zoo.java



/** 象のデータの操作の実験のクラス @version 1.3
 *  配列を利用
 */
public class Zoo {

  /** 処理の開始 */
    public static void main( String[] argv ) {

        Elephant ele[] = new Elephant[3];
        ele[0] = new Elephant( "Hanako", 7 );
        ele[1] = new Elephant( "Tarou", 8 );
        ele[2] = new Elephant( "Gonta", 1 );

        for( int i=0; i<3; i++ )
            System.out.println( ele[i].toString() );
    }
}