This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I agree with Liviu and Sherry - the original code for ByteError (using "b = b * 2;") does not compile. JDK versions 1.3.1_15, 1.4.2_08, and 1.5.0_04 all give the exact same error message:
I'm not sure what is going on with Jagan and Emilia. I believe either you've changed the code somehow, or you're not compiling what you think you're compiling. (Or possibly you've got a specific compiler version with a very strange bug.) Please try compiling the following:
The key line "b = b * 2;" is unchanged (and yes you must have the line exactly like this); I've just added some diagnostic print statements. If the program compiles for you, please report exactly what output you get. Thank you.
The code does not compile , Gives the error message Type mismatch cannot convert from int to byte.
Joined: Jan 16, 2004
Just quickly saw the replies to this post. Sorry I haven't been able to respond. I'm away at a conference. So, I may not be able to respond back until Tuesday. Also, I had to re-image my machine. But starting Tuesday, when I get back, I will have more time to get back to this topic and SCJP study in general. Until then, you folks take care and have a wonderful weekend.
Anbudan & Mahalo,<br />Arul<br /> <br />-Not a sun certified Java professional :-)
Joined: Jan 30, 2000
OK, everybody but Jagan has agreed this code doesn't compile. I don't think we need any more posters saying the same thing - at least not until Jagan has an opportunity to look again at what's going on.