Array array = new Array();
array.add( new Integer( 100 ) );
array.add( new Integer( 2 ) );
array.add( new Integer( 71 ) );
System.out.println( "array = " + array );
System.out.println
(
"injecting TimesNumber(initial value==1) = "
+ Applying.inject
(
array.begin(),
array.end(),
new Integer( 1 ),
new TimesNumber()
)
);
System.out.println
(
"injecting PlusNumber(initial value==0) = "
+ Applying.inject( array, new Integer( 0 ), new PlusNumber() )
);
System.out.println
(
"injecting MinusNumber(initial value==0) = "
+ Applying.inject( array, new Integer( 0 ), new MinusNumber() )
);
System.out.println
(
"injecting DividesNumber(initial value==100000) = "
+ Applying.inject( array, new Integer( 100000 ), new DividesNumber() )
);