<p>This is because each of the if statements are independent from each other. Whether or not the if statement gets check is not affected by the if statements around it.</p>
<p>Since the preferred language equals Spanish it outputs <code>Hola!</code> But since the language is also <em>not German</em> it prints out <code>Hello!</code> as well.</p>
<h2>Using an Array</h2>
<p>Square brackets notation is used to access elements, array slots can be used as variables</p>
<pre><codeclass="language-java">int[] array = new int[7]; // Creates an integer array of size 7
array[0] = 5;</code></pre>
<h2>Swapping Elements</h2>
<p>You can swap <code>x</code> and <code>y</code> in the following way with a <em>temporary</em> variable</p>
<pre><codeclass="language-java">int x = 6;
int y = 1;
int temp = x;
x = y;
y = temp;</code></pre>
<h2>Two-Dimensional Arrays</h2>
<pre><codeclass="language-java">// Creates a 2D array of two rows and three columns
int[][] a = new int[2][3]</code></pre>
<p>You can access an element of this 2D array using the conventional square bracket notation</p>