From 2554147d0cc6c9bd76d6d7a415c3e5829e1ca7bb Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 20 Mar 2024 19:16:16 +0100 Subject: improve my handout for reference arrays --- Info/23_24/02/20/10B/handout.tex | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Info/23_24/02/20/10B/handout.tex b/Info/23_24/02/20/10B/handout.tex index a535a4c6..51fc07d9 100644 --- a/Info/23_24/02/20/10B/handout.tex +++ b/Info/23_24/02/20/10B/handout.tex @@ -10,9 +10,9 @@ \begin{tabular}{p{0.4\textwidth} p{0.1\textwidth} p{0.49\textwidth}} \begin{defbox}{Syntax} \begin{itemize} - \item \textbf{Datentyp}: - \item \textbf{Deklaration}: - \item \textbf{Initialisierung}: + \item \textbf{Datentyp}: \solution{KLASSENNAME[]} + \item \textbf{Deklaration}: \solution{KLASSENNAME{} feldname;} + \item \textbf{Initialisierung}: \solution{feldname = new KLASSENNAME[laenge];} \end{itemize} \end{defbox} & & @@ -23,10 +23,10 @@ class SPIELAUTOMAT { $\solution{SPIELWALZEN[] walzen;}$ // SPIELAUTOMAT Konstruktor - SPIELAUTOMAT($\solution{int n~~~~~~~~~}$) { + SPIELAUTOMAT($\solution{int n }$) { // Initialisierung Spielwalzen Feld $walzen = \solution{new SPIELWALZEN[n];}$ - for (int i = 0; i < $\solution{walzen.length~~~~~~~}$; i++) { + for (int i = 0; i < $\solution{walzen.length }$; i++) { // Initialisierung der einzelnen Spielwalzen $\solution{walzen[i] = new SPIELWALZE(i*100, 0);}$ $\solution{}$ @@ -89,7 +89,7 @@ font=\small}] class SPIELAUTOMAT { $\solution{SPIELWALZEN[] walzen;}$ - SPIELAUTOMAT($\solution{int n~~~~~~~~}$) { + SPIELAUTOMAT($\solution{int n }$) { walzen = SPIELWALZE$\solution{[n];}$ } ... -- cgit v1.2.3