diff --git a/Doc/Sd1/gettingStarted.xml b/Doc/Sd1/gettingStarted.xml index 24999064097fcd52fe6183c117dd32de75bfc916..f1477a6c3f6fcc4de0fe392aaffd7e856aeb8c50 100644 --- a/Doc/Sd1/gettingStarted.xml +++ b/Doc/Sd1/gettingStarted.xml @@ -468,7 +468,9 @@ <calloutlist role="slideExclude"> <callout arearefs="sd1_callout_usingExercises-1-co" xml:id="sd1_callout_usingExercises-1"> - <para>The question to be answered.</para> + <para>The question to be answered. See <link + linkend="sd1_qanda_hotelKeyCard">current example in + real</link>.</para> </callout> <callout arearefs="sd1_callout_usingExercises-2-co" @@ -1020,7 +1022,7 @@ public class HelloWorld <co output filename <filename>HelloWorld.class</filename>.</para> </callout> - <callout arearefs="sd1_fig_imageco_compileJava-bytecodeFile" + <callout arearefs="sd1_fig_compileJava-bytecodeFile" xml:id="sd1_fig_imageco_compileJava-bytecodeFile"> <para>A <xref linkend="glo_Java"/> bytecode file contains instructions to be interpreted by a <xref linkend="glo_Java"/> run @@ -1028,9 +1030,9 @@ public class HelloWorld <co files are not meant to be viewed or edited.</para> <para>The main advantage of bytecode files is becoming independent - from a specific target operating system. Thus a given + of operating systems. Thus a given <classname>HelloWorld.class</classname> file may be executed on - Linux, Windows, Mac-OS and or any other <xref linkend="glo_JRE"/> + Linux, Windows, Mac-OS or any other <xref linkend="glo_JRE"/> providing system in exactly the same way.</para> </callout> </calloutlist> @@ -1174,7 +1176,7 @@ ls: cannot access '<emphasis role="red">HelloWorld.class</emphasis>': No such fi </figure> <figure xml:id="sd1_fig_imageco_executeJavaScreen"> - <title>Shell byte code file <filename>HelloWorld.class</filename> + <title>Command line byte code file <filename>HelloWorld.class</filename> execution</title> <screen>> java HelloWorld @@ -1196,9 +1198,9 @@ Hello, world</screen> <listitem> <para>Linux <productname>Debian</productname> / <productname>Ubuntu - 18.04:</productname></para> + 22.04:</productname></para> - <screen>apt install openjdk-11-jdk</screen> + <screen>apt install openjdk-17-jdk</screen> </listitem> </itemizedlist> </figure> @@ -1249,8 +1251,8 @@ Hello, world</screen> <screen>Hello, World ...</screen> <para>Extend the above code to produce a whole paragraph of - sentences rather than just a single line. Your output might - read:</para> + sentences rather than just one single line. Your output + might read:</para> <screen>Those who can do. Those, who cannot, teach. @@ -1357,9 +1359,9 @@ Hello, world <co linkends="sd1QandaSnippetHelloWorldExecuteStep-2" <orderedlist> <listitem> - <para>Using upcoming <link + <para>Using <link xlink:href="https://blogs.oracle.com/javamagazine/text-blocks-come-to-java">Java - 13 multiline string literals</link>:</para> + 13 multiline string literals</link> (easy):</para> <programlisting language="none">public static void main( String[] args ) { System.out.println(<emphasis role="red">"""</emphasis> @@ -1368,12 +1370,6 @@ Hello, world <co linkends="sd1QandaSnippetHelloWorldExecuteStep-2" Those, who cannot teach, lecture trainee teachers teaching methodology.<emphasis role="red">"""</emphasis> ); }</programlisting> - - <warning> - <para>As of April 2020 this may require <link - xlink:href="https://youtrack.jetbrains.com/issue/IDEA-216558">additional - IDE settings</link>.</para> - </warning> </listitem> <listitem> @@ -1520,10 +1516,9 @@ public class HelloWorld { </listitem> <listitem> - <para>Solving this error requires replacing the class name + <para>Compilation requires replacing the class name <classname>HelloWorld</classname> by - <classname>Advance</classname> and thus allows for compiling - and executing as before:</para> + <classname>Advance</classname>:</para> <informaltable border="0"> <tr> @@ -1698,8 +1693,7 @@ SourceFile^A^@^OHelloWorld.java^L^@^G^@^H^G^@^W^L^@^X^@^Y^A^@^L<emphasis <answer> <orderedlist> <listitem> - <para>Using a simple text editor may lead to - disaster:</para> + <para>Using a simple text editor doesn't work:</para> <screen>>java HelloWorld Error: LinkageError occurred while loading main class HelloWorld @@ -1791,8 +1785,8 @@ Error: LinkageError occurred while loading main class HelloWorld role="red">â–²</emphasis> <emphasis role="red">â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”›</emphasis> <emphasis role="red">┃</emphasis> - <emphasis role="red">â–¼</emphasis> will be overridden -.............<emphasis role="red">Hello, world</emphasis>... by »!« or 21</screen> + <emphasis role="red">â–¼</emphasis> will be overridden by +.............<emphasis role="red">Hello, world</emphasis>... »!« or 21 respectively</screen> <para>Thus appending an exclamation mark will override the hexadecimal <code language="java">07</code> value diff --git a/Doc/Sd1/languageFundamentals.xml b/Doc/Sd1/languageFundamentals.xml index 7b4341ade2a5277ac614394d20cc2db6b7285c50..128dbb4659586151a06179e1bcb6e5a5ee0dfe0b 100644 --- a/Doc/Sd1/languageFundamentals.xml +++ b/Doc/Sd1/languageFundamentals.xml @@ -4396,23 +4396,23 @@ System.out.println(df.format(Float.intBitsToFloat( <figure xml:id="sd1_fig_wideningLadder"> <title>A widening «ladder»</title> - <programlisting language="java">byte byteVariable = 42; // Narrowing: int literal to byte -short shortVariable = byteVariable; // Widening -int intVariable = shortVariable; // Widening -long longVariable = intVariable; // Widening -float floatVariable = longVariable; // Widening -double doubleVariable = floatVariable; // Widening</programlisting> + <programlisting language="java">byte b = 42; // Narrowing: constant int literal to byte +short s = b; // Widening +int i = s; // Widening +long l = i; // Widening +float f = l; // Widening +double d = f; // Widening</programlisting> </figure> <figure xml:id="sd1_fig_narrowingLadder"> <title>A narrowing «ladder»</title> - <programlisting language="java">double doubleVariable = 14.23; -float floatVariable = (float) doubleVariable; // Narrowing -long longVariable = (long) floatVariable; // Narrowing -int intVariable = (int) longVariable; // Narrowing -short shortVariable = (short) intVariable; // Narrowing -byte byteVariable = (byte) shortVariable; // Narrowing</programlisting> + <programlisting language="java">double d = 14.23; +float f = (float) d; // Narrowing +long l = (long) f; // Narrowing +int i = (int) l; // Narrowing +short s = (short) i; // Narrowing +byte b = (byte) s; // Narrowing</programlisting> </figure> <qandaset defaultlabel="qanda" xml:id="sd1_qanda_intConverChar"> @@ -4715,16 +4715,16 @@ System.out.println( 3.14d );</programlisting></td> </tr> <tr> - <td valign="top"><programlisting language="java">float d = 3.14f;</programlisting></td> + <td valign="top"><programlisting language="java">float f = 3.14f;</programlisting></td> <td valign="top">o.K., assigning <code language="java">float</code> to <code - language="java">float</code> (widening)</td> + language="java">float</code></td> </tr> <tr> <td valign="top"><programlisting language="java"><emphasis - role="red">float d = 3.14d;</emphasis></programlisting></td> + role="red">float f = 3.14d;</emphasis></programlisting></td> <td valign="top"><emphasis role="red">Error, assigning <code language="java">double</code> to <code @@ -4733,10 +4733,10 @@ System.out.println( 3.14d );</programlisting></td> <tr> <td valign="top"><programlisting language="java"><emphasis - role="red">float d = 3.14;</emphasis></programlisting></td> + role="red">float f = 3.14;</emphasis></programlisting></td> - <td valign="top"><emphasis role="red">Error, assigning <code - language="java">double</code> to <code + <td valign="top"><emphasis role="red">Error, assigning + (implicit) <code language="java">double</code> to <code language="java">float</code> as well.</emphasis></td> </tr> </informaltable> @@ -5899,7 +5899,8 @@ System.out.println(2147483647 + 1L);</programlisting> IEEE representations: A given value will be approximated as close as possible.</para> - <para>Adding <code language="java">System.out.println(x - y)</code> yields a value of -1.1102230246251565E-16 denoting the + <para>Adding <code language="java">System.out.println(x - + y)</code> yields a value of -1.1102230246251565E-16 denoting the representational deviation of <code language="java">x</code> and <code language="java">y</code>.</para> diff --git a/Doc/Tdoc/general.xml b/Doc/Tdoc/general.xml index ecb7ba76a038673de033ca003413714632f2dcc9..e3bed5590bf52c619197a8053074d4bb2a6d1dc5 100644 --- a/Doc/Tdoc/general.xml +++ b/Doc/Tdoc/general.xml @@ -1989,20 +1989,22 @@ See remark at page 1.</literallayout></td> <td valign="top"><para>.</para><mediaobject> <imageobjectco> <areaspec otherunits="imagemap" units="other"> - <area coords="83,16,340,187" units="calspair" + <area coords="83,16,340,187" linkends="fig_imagemapCallout_calloutSeat" - xml:id="fig_imagemapCallout_seat"> + units="calspair" xml:id="fig_imagemapCallout_seat"> <alt>Seat</alt> </area> - <area units="calspair" coords="112,335,151,370" + <area coords="112,335,151,370" linkends="fig_imagemapCallout_calloutValve" + units="calspair" xml:id="fig_imagemapCallout_valveBack"> <alt>Valve</alt> </area> - <area units="calspair" coords="511,345,550,380" + <area coords="511,345,550,380" linkends="fig_imagemapCallout_calloutValve" + units="calspair" xml:id="fig_imagemapCallout_valveFront"> <alt>Valve</alt> </area> @@ -2489,16 +2491,16 @@ See <xref linkend="intro"/> ...</programlisting> <mediaobject> <imageobjectco> <areaspec otherunits="imagemap" units="other"> - <area units="calspair" coords="357,43,453,90" - linkends="xmlc_callout_permalink-id01" + <area coords="357,43,453,90" + linkends="xmlc_callout_permalink-id01" units="calspair" xml:id="xmlc_area_permalink-id01"/> - <area units="calspair" coords="422,92,575,128" - linkends="xmlc_callout_permalink-id02" + <area coords="422,92,575,128" + linkends="xmlc_callout_permalink-id02" units="calspair" xml:id="xmlc_area_permalink-id02"/> - <area units="calspair" coords="467,170,588,214" - linkends="xmlc_callout_permalink-id03" + <area coords="467,170,588,214" + linkends="xmlc_callout_permalink-id03" units="calspair" xml:id="xmlc_area_permalink-id03"/> </areaspec> @@ -3159,7 +3161,7 @@ xmlns="http://docbook.org/ns/docbook"> <callout arearefs="xmlc_cout_masterExample-3-co" xml:id="xmlc_cout_masterExample-3"> - <para>Filename reference</para> + <para>Fist module filename reference</para> </callout> </calloutlist></td> @@ -3171,7 +3173,7 @@ xmlns="http://docbook.org/ns/docbook"> <callout arearefs="xmlc_cout_masterExample-5-co" xml:id="xmlc_cout_masterExample-5"> - <para>Filename reference</para> + <para>Second module filename reference</para> </callout> <callout arearefs="xmlc_cout_masterExample-6-co"