This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
I am feverishly preparing for the SCJA exam and have a "rule of thumb" question.
Some of the practice questions in Cameron McKenzie's book test whether you know if sample code will compile\run, even if it doesn't look pretty. In a few of the practice questions, I also noticed that answers were eliminated because they didn't follow name conventions, but would compile (i.e. Mock Exam Questions, pg. 77, answer 3-19).
So if a possible answer does not follow naming convention, but will compile, should it be thought of as correct or incorrect? Does Sun provide any guidance on the issue?
Let me also say that Cameron's books have been extremely helpful and my post is in no way a dig at him.
Thanks so much for the kind words. I didn't take them as anything but complimentary!
Indeed, many exam questions skip the 'conventions', but it's often just to save space it would appear. Don't think the lack of a getter or setter might imply that Sun wants you to say the code is bad or does not compile. Indeed, it will compile!
So, don't be surprised at code snippets that avoid naming conventions. If indeed they are quizing you about the topic of naming conventions, one of the answers will deal explicitly with the topic.