Beispiel: Keller
Wir betrachten nochmals die Kellerimplementierung mittels Feld und Pegel (ohne Fehlerbehandlung).
{ protected static final int SIZE = 100 ; // Klassenkonstante
protected int top_pt ; // Pegel
protected int [] stack ; // Kellerinhalt
public IntStack () // Konstruktor, nicht synch.
{ top_pt = 0 ; stack = new int [SIZE] ; }