public int max(){
  if (size() == 0) {
    throw new IllegalStateException("cannot find maximum of an empty list");
  }
  int max=_data[_pos - 1];
  for (int i=_pos - 1; i-- > 0; ) {
    max=Math.max(max,_data[_pos]);
  }
  return max;
}

public int max ( ) { if ( size ( ) == 0 ) { throw new IllegalStateException ( "cannot find maximum of an empty list" ) ; } int max = _data [ _pos - 1 ] ; for ( int i = _pos - 1 ; i -- > 0 ; ) { max = Math . max ( max , _data [ _pos ] ) ; } return max ; }
finds the maximum value in the list .
