posted 20 years ago
What's the most slickest way to initialize arrays (which are attributes) in a constructor?
For example, the following code does not work:
So I have to do the following instead:
Two questions:
Was the 2nd code snipplet the best "professional" way to do it?
And why wouldn't the first code snipplet work, even though I can do it if I declare an array and initialize all on a single line?
Many thanks!
CF
[ April 25, 2002: Message edited by: Craig Flannagan ]
<blockquote><font size="1" face="Verdana, Arial">code:</font><hr><pre><font size="2"><br />boolean isDevilish(Human h)<br />{<br /> return (h==CraigFlannagan);<br />}<br /></font></pre><hr></blockquote>