Ran into something a bit strange; if I have a component array it won't allow me to initialize each component outside of the constructor. An example of what I mean:
But...
Is assigning the 'new' keyword here doing something executable that can't be in declaration? Thanks much, Tetsuo!
Manfred Leonhardt
Ranch Hand
Joined: Jan 09, 2001
Posts: 1492
posted
0
Hi Tetsuo, You are not seeing something a little strange. You are seeing how java works! An assignment (to any variable) can be done in two ways: 1) Along with declaration:
2) Inside any code block (defined by braces {}):
Java will not let you perform assignments outside code blocks with the exception of number 1 above. Regards, Manfred. [ March 14, 2002: Message edited by: Manfred Leonhardt ]
Sun Certified Programmer for the Java 2 Platform.<br />Sun Certified Programmer for the Java 2 Platform, 1.4.<br />Sun Certified Web Component Developer<br />IBM Certified Specialist VisualAge for Java.<br />IBM Certified Solution Developer (OOAD w/ UML).
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.