// lowArray.java // demonstrates array class with low-level interface // to run this program: C>java LowArrayApp //////////////////////////////////////////////////////////////// class LowArray { private long[] a; // ref to array a //-------------------------------------------------------------- public LowArray(int size) // constructor { a = new long[size]; } // create array //-------------------------------------------------------------- public void setElem(int index, long value) // set value { a[index] = value; } //-------------------------------------------------------------- public long getElem(int index) // get value { return a[index]; } //-------------------------------------------------------------- } // end class LowArray //////////////////////////////////////////////////////////////// class LowArrayApp { public static void main(String[] args) { LowArray arr; // reference arr = new LowArray(100); // create LowArray object int nElems = 0; // number of items in array int j; // loop variable arr.setElem(0, 77); // insert 10 items arr.setElem(1, 99); arr.setElem(2, 44); arr.setElem(3, 55); arr.setElem(4, 22); arr.setElem(5, 88); arr.setElem(6, 11); arr.setElem(7, 00); arr.setElem(8, 66); arr.setElem(9, 33); nElems = 10; // now 10 items in array for(j=0; j