home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BUG 15
/
BUGCD1998_06.ISO
/
aplic
/
jbuilder
/
jsamples.z
/
Counting5.java
< prev
next >
Wrap
Text File
|
1997-07-30
|
682b
|
32 lines
// Copyright(c) 1997 ObjectSpace, Inc.
import COM.objectspace.jgl.*;
/**
* Calculate and sum the difference between adjacent pairs of values.
*
* @see COM.objectspace.jgl.Counting
* @version 2.0.2
* @author ObjectSpace, Inc.
*/
public class Counting5
{
public static void main( String[] args )
{
Array array = new Array();
for ( long i = 1; i <= 10; ++i )
array.add( new Long( i ) );
System.out.println( array );
Array result = new Array();
Counting.adjacentDifference
(
array,
result,
new TimesNumber( new Long( 0 ).getClass() )
);
System.out.println( result );
}
}