Implementazione del sottotipo 2
public class MaxIntSet extends IntSet {
// OVERVIEW: un MaxIntSet č un sottotipo di IntSet che lo estende con
private int mass; // l’elemento massimo, se this non č vuoto
public int max () throws EmptyException
// EFFECTS: se this č vuoto solleva EmptyException, altrimenti
// ritorna l’elemento massimo in this
{if (size( ) == 0) throw new
EmptyException(“MaxIntSet.max”); return mass;}
usa un metodo ereditato dal supertipo (size)