Hi Janet Smith,
First of all, a warm welcome to CodeRanch!
Janet Smith wrote:I'm using the OCA/OCP Java SE7 Programmer I and II Study guide by Kathy Sierra and Bert Bates.
Excellent choice! It's probably the best study guide currently available on the market for the OCAJP7 (and OCPJP7) certification exam.
Janet Smith wrote:One in particular that I'm looking back at today is in the 1st Self Test:
In
this topic you'll find an excellent explanation about the exact same question (code snippet). I'm pretty sure after carefully reading this topic all your doubts (concerning this topic) will be cleared. If you still have doubts/questions after reading this topic, simply click on the "Post reply" button and let us know
Janet Smith wrote:This isn't the first time I've come across 'interesting' syntax in a test that is not mentioned, or is only covered by a single line in the book.
This question is more about the very weird identifiers (class name, variable name and parameter name) than about the
for loop itself.
Janet Smith wrote:So my question is how to deal with things like this? Are there other sources I should be using in preparation for the test that might cover things like this? Possibly the Mala Gupta book? Or different online resources? I haven't downloaded the Enthuware tests yet because I don't want to tackle them until I'm more confident i.e. I don't want to waste them. I'm guessing a lot more coding would be a good idea. But its the fact that I don't know that these types of syntaxes exist in the first place, so how to know to use them in my own code is the question.
You don't provide any background information about your own Java experience. To prepare for the OCAJP7 certification exam, you don't need any other study guide than K&B7. This study guide is especially written to prepare yourself for this certification exam. But if you have no (or very little) experience in Java, it might be useful to first read a Java text book before reading (and studying) a certification study guide. And you could of course buy the Mala Gupta study guide as well and use it as a complementary resource. But it is not required, if you prepare thoroughly using the K&B7 study guide, you'll know everything to pass the exam.
You should definitely write lots and lots of code, preferrably using your favourite text editor,
javac and
java (and thus not using an
IDE). And each code snippet in the study guide is a very good starting point for these coding exercises. You can experiment a bit with these code snippets (e.g. rename a method, use another access modifier, change the name, change the data type, and so on). Then you can tell yourself what will happen with the code (will it compile, will you get a runtime exception, what will be the output) and finally you compile and run the code to see if you were correct or not. The more you proceed through the study guide, the more syntax you will learn and need to master to pass the exam. That's one of the benefits about using a certification study guide: it's written especially for this certification exam, so you'll need to know everything explaind in the study guide to pass the exam.
Hope it helps!
Kind regards,
Roel