%% -*- mode: latex; TeX-master: "informatik.tex"; -*-

\begin{slide}{Bsp: Interfaces und Standard-Klassen}

\kopf{$ $Id: collect.tex,v 1.1 2006-10-09 13:24:18 waldmann Exp $ $}

\begin{minipage}{0.56\textwidth}
\begin{verbatim}
interface Collection {
  boolean add (Object o);
  Iterator iterator ();
}
\end{verbatim}
\end{minipage}
\rule[-2cm]{1pt}{5cm}
\begin{minipage}{0.35\textwidth}
\begin{verbatim}
interface Iterator { 
  boolean hasNext (); 
  Object next ();
}
\end{verbatim}
\end{minipage}

\hrule

\begin{minipage}{0.56\textwidth}
\begin{verbatim}
interface Set 
  extends Collection { }
\end{verbatim}
\end{minipage}
\rule[-1cm]{1pt}{2.5cm}
\begin{minipage}{0.35\textwidth}
\begin{verbatim}
class TreeSet 
  implementes Set
\end{verbatim}
\end{minipage}

\hrule

\begin{verbatim}
String [] a = { "eins", "zwei", "drei", "vier" };
TreeSet t;
for (int k = 0; k < a.length; k++ ) 
  { t.add (a [k]); }
Iteraror it = t.iterator ();
while (it.hasNext()) 
  { System.out.print (it.next() + " "); }
\end{verbatim}


\end{slide}
