\documentclass[a5paper,landscape]{handout} \csname endofdump\endcsname \usepackage{minted} \begin{document} \thispagestyle{empty} \subsection*{\underline{Felder von komplexen Datentypen}} \begin{tabular}{p{0.4\textwidth} p{0.1\textwidth} p{0.49\textwidth}} \begin{defbox}{Syntax} \begin{itemize} \item \textbf{Datentyp}: \solution{KLASSENNAME[]} \item \textbf{Deklaration}: \solution{KLASSENNAME{} feldname;} \item \textbf{Initialisierung}: \solution{feldname = new KLASSENNAME[laenge];} \end{itemize} \end{defbox} & & \begin{minipage}[t]{0.59\textwidth} \begin{minted}[escapeinside=$$]{java} class SPIELAUTOMAT { // Deklaration Spielwalzen Feld $\solution{SPIELWALZEN[] walzen;}$ // SPIELAUTOMAT Konstruktor SPIELAUTOMAT($\solution{int n }$) { // Initialisierung Spielwalzen Feld $walzen = \solution{new SPIELWALZEN[n];}$ for (int i = 0; i < $\solution{walzen.length }$; i++) { // Initialisierung der einzelnen Spielwalzen $\solution{walzen[i] = new SPIELWALZE(i*100, 0);}$ $\solution{}$ } } } \end{minted} \end{minipage} \\ \end{tabular} \subsection*{\underline{1 zu n Beziehungen in Java}} \begin{tabular}{p{0.49\linewidth} p{0.49\linewidth}} \vspace{0.5cm} \begin{tikzpicture}[ class/.style={ draw, rectangle, minimum width={width("SPIELAUTOMAT")}, font=\small}] \node[class] (sa) at (0,0) {SPIELAUTOMAT}; \node[class] (sw) at (7, 0) {SPIELWALZE}; \draw (sa.east) edge[above, align=center] node {\small 1 ~~~~ $>$ enthält ~~~~ 3} (sw.west); \end{tikzpicture} & \begin{minipage}[t]{0.49\textwidth} \begin{minted}[]{java} class SPIELAUTOMAT { SPIELWALZEN walze1; SPIELWALZEN walze2; SPIELWALZEN walze3; ... } \end{minted} \end{minipage} \\ \LARGE \hspace{5cm} $\Downarrow$ & \hspace{2cm} \LARGE $\Downarrow$ \\ \vspace{1cm} \begin{tikzpicture}[ class/.style={ draw, rectangle, minimum width={width("SPIELAUTOMAT")}, font=\small}] \node[class] (sa) at (0,0) {SPIELAUTOMAT}; \node[class] (sw) at (7, 0) {SPIELWALZE}; \draw (sa.east) edge[above, align=center] node {\small 1 ~~~~ $>$ enthält ~~~~ \boldred{n}} (sw.west); \end{tikzpicture} & \vspace{0.5cm} \begin{minipage}[t]{0.49\textwidth} \begin{minted}[escapeinside=$$]{java} class SPIELAUTOMAT { $\solution{SPIELWALZEN[] walzen;}$ SPIELAUTOMAT($\solution{int n }$) { walzen = SPIELWALZE$\solution{[n];}$ } ... } \end{minted} \end{minipage} \\ \end{tabular} \end{document}