Multiple distinct objects: Difference between revisions

→‎{{header|Modula-3}}: fixed a typo introduced by the new version
(→‎{{header|Modula-3}}: added the mistake)
(→‎{{header|Modula-3}}: fixed a typo introduced by the new version)
Line 884:
END DistinctObjects.</lang>
{{out}}
Each line interleaves the initial values of <code>a</code> and <code>b</code>. The first one has default values; the second replaces the values of <code>a</code> with random, "re-initialized" integers. Only <code>a[3]</code> starts with the default value for <code>T</code>; see the fifthseventh number in the first line. On the other hand, the modification of "one" element of <code>c</code> actually modifies every element, precisely because it is a reference and not an object.
<pre>
3 , -9 , 100 ; 4 , 2 , 100 ; 2 , 6 , 100 ;
Anonymous user