Commit cbae1035 authored by Dr. Martin Goik's avatar Dr. Martin Goik

Two-dimensional arrays, adding «void» in move method

parent 0f55dee5
...@@ -1975,7 +1975,7 @@ public class AppTest { ...@@ -1975,7 +1975,7 @@ public class AppTest {
</info> </info>
<figure xml:id="sd1_array_fig_multidimArray"> <figure xml:id="sd1_array_fig_multidimArray">
<title><methodname>Multidimensional arrays</methodname></title> <title><methodname>Two-dimensional arrays</methodname></title>
<programlisting language="java">int[][] matrix = new int[2][3]; <programlisting language="java">int[][] matrix = new int[2][3];
......
...@@ -43,15 +43,15 @@ ...@@ -43,15 +43,15 @@
xml:id="sda_inherit_fig_DuplicateCode-1-co"/> xml:id="sda_inherit_fig_DuplicateCode-1-co"/>
<emphasis role="red">private double y</emphasis>; <emphasis role="red">private double y</emphasis>;
<emphasis role="red">public move (double dx, double dy){</emphasis> <co <emphasis role="red">public void move
(double dx, double dy){</emphasis> <co
linkends="sda_inherit_fig_DuplicateCode-2" linkends="sda_inherit_fig_DuplicateCode-2"
xml:id="sda_inherit_fig_DuplicateCode-2-co"/> xml:id="sda_inherit_fig_DuplicateCode-2-co"/>
<emphasis role="red">x += dx; <emphasis role="red">x += dx;
y += dy; y += dy;
}</emphasis> }</emphasis>
private double width, height; <co linkends="sda_inherit_fig_DuplicateCode-3" private double width, height; <co linkends="sda_inherit_fig_DuplicateCode-3"
xml:id="sda_inherit_fig_DuplicateCode-3-co"/> xml:id="sda_inherit_fig_DuplicateCode-3-co"/> ...
...
}</programlisting></td> }</programlisting></td>
<td valign="top"><programlisting language="none">public class Circle { <td valign="top"><programlisting language="none">public class Circle {
...@@ -60,13 +60,13 @@ ...@@ -60,13 +60,13 @@
linkend="sda_inherit_fig_DuplicateCode-1-co"/> linkend="sda_inherit_fig_DuplicateCode-1-co"/>
<emphasis role="red">private double y</emphasis>; <emphasis role="red">private double y</emphasis>;
<emphasis role="red">public move (double dx, double dy){</emphasis> <coref <emphasis role="red">public void move
(double dx, double dy){</emphasis> <coref
linkend="sda_inherit_fig_DuplicateCode-2-co"/> linkend="sda_inherit_fig_DuplicateCode-2-co"/>
<emphasis role="red">x += dx; <emphasis role="red">x += dx;
y += dy; y += dy;
}</emphasis> }</emphasis>
private double radius; <coref linkend="sda_inherit_fig_DuplicateCode-3-co"/> private double radius; <coref linkend="sda_inherit_fig_DuplicateCode-3-co"/> ...
...
}</programlisting></td> }</programlisting></td>
</tr> </tr>
</informaltable> </informaltable>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment