Scott Selikoff wrote:Special things happen with the compound assignment operators, such as +=, if you keep reading!
Paul Clapham wrote:Here's what the Java 1.0 JLS says about that topic: http://titanium.cs.berkeley.edu/doc/java-langspec-1.0/5.doc.html#170768
I invite you to compare the two and see if there are any differences. I wouldn't think there were, since language features related to primitives haven't changed at all as far as I know. There's boxing and unboxing, and there's parameter typing, but I don't believe any of those should affect how primitives work. The Java designers are quite careful about forward compatibility between versions.
Tony Docherty wrote:
Or put simply the compiler can auto downcast the expression if it is a constant of type byte, short, char, or int and it is being assigned to a variable of type byte, short, or char and it will fit into that variable. ie 127 can be assigned to a variable of type byte but 1024 can't be.
Srini Jayaraman wrote:
Can you suggest for the error on line 27 if possible. Thanks again
[puddle, quack]
[quack, puddle]
Duc Ta wrote:
I know it, but if I never enter into the loop it mean that the method variables i and j is never initialized. It mean that there will compile error because the value of method variables must be initialized before they are used, but there is no error the code compile normally. This is my confusing part.