diff --git a/Sd1/swd1.xml b/Sd1/swd1.xml index 0161eb45b0e5fe5bebca7092103042530f304eae..816b7cc45eb926b4202c6f1dc534b3339bea0291 100644 --- a/Sd1/swd1.xml +++ b/Sd1/swd1.xml @@ -6596,9 +6596,12 @@ b1 == b2: false <co linkends="answerCoStringOperatorEquality-2" <callout arearefs="answerCoStringOperatorEquality-2-co" xml:id="answerCoStringOperatorEquality-2"> - <para>b1 and b2 are being constructed as two different - instances albeit containing the same value. Following the - above reasoning we may execute:</para> + <para>Every call to a constructor will create a new object + regardless of internal state. Thus <code>b1</code> and + <code>b2</code> will hold two distinct references pointing + to different String instances albeit these two instances + contain identical values. Following the above reasoning we + may execute:</para> <programlisting language="java">System.out.println("Hashcode b1 == " + System.identityHashCode(b1) + ", Hashcode b2 == " + System.identityHashCode(b2));</programlisting> @@ -6609,7 +6612,7 @@ b1 == b2: false <co linkends="answerCoStringOperatorEquality-2" <programlisting language="none">Hashcode b1 == 1829164700, Hashcode b2 == 2018699554</programlisting> <para>Comparing these two values for equality via the - <quote>==</quote> operator will return the boolean value + <quote>==</quote> operator thus returns the boolean value <code>false</code>.</para> </callout> </calloutlist>