There is still a problem with the solution provided by mdv2000, which is that if the first value entered is SENTINEL, smallest and largest remain as Integer.MAX_VALUE and Integer.MIN_VALUE...