public Vector select(int[] indices) {
        int newLength = indices.length;

        if (newLength == 0) {
            fail("No elements selected.");
        }

        Vector result = blankOfLength(newLength);

        for (int i = 0; i < newLength; i++) {
            result.set(i, get(indices[i]));
        }

        return result;
    }
public Vector select ( int [ ] indices ) { int newLength = indices . length ; if ( newLength == 0 ) { fail ( "No elements selected." ) ; } Vector result = blankOfLength ( newLength ) ; for ( int i = 0 ; i < newLength ; i ++ ) { result . set ( i , get ( indices [ i ] ) ) ; } return result ; }
Returns a new vector with the selected elements.

@param indices the array of indices

@return the new vector with the selected elements