Skip to content
Snippets Groups Projects
Commit b17e94c1 authored by Goik Martin's avatar Goik Martin
Browse files

Cosmetics

parent f7d6c7d2
Branches
No related tags found
No related merge requests found
......@@ -552,10 +552,12 @@ if (day.equals(Day.FRIDAY)) ...</programlisting>
the <quote>==</quote> operator is sufficient. Due to the way <code
language="java">enum</code>'s are being constructed instance
creation is being limited to the underlying <code
language="java">enum</code>'s scope by its implicitly private
constructor. It is thus impossible to create new instances outside
the respective <code language="java">enum</code>'s scope.
Therefore object identity and equality of values are being
language="java">enum</code>'s scope by its implicitly <code
language="java">private</code> declared constructor. It is thus
impossible to create new instances outside the respective <code
language="java">enum</code>'s scope.</para>
<para>Therefore object identity and equality of values are being
guaranteed to match exactly for two arbitrary instances belonging
to the same <code language="java">enum</code> class:</para>
......@@ -565,8 +567,8 @@ final boolean
<emphasis role="red">objectIdentity</emphasis> = (e1 == e2), // Both boolean values will
<emphasis role="red">objectEquality</emphasis> = e1.equals(e2); // always be equal.</programlisting>
<para>In case of <code language="java">null</code> values using
the <quote>==</quote> operator avoids
<para>As an aside: In case of <code language="java">null</code>
values using the <quote>==</quote> operator avoids
<classname>java.lang.NullPointerException</classname>
problems:</para>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment