aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes correct method for reading code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "correct method for reading code" Watch "correct method for reading code" New topic
Author

correct method for reading code

Rob Petterson
Ranch Hand

Joined: Jan 23, 2002
Posts: 149
Hi all,
I've often wondered about this - is there a correct way to read code in exam questions? Do you start from the top and work your way down, or do you locate the main() method (if there is one)and work from there? Which method can you suggest that works best?


Rob Petterson
SCJP
Jessica Sant
Sheriff

Joined: Oct 17, 2001
Posts: 4313

I think that's definately a personal choice -- but I tend to start at the main --- and follow the execution of the program: step-by-step.
Reid M. Pinchback
Ranch Hand

Joined: Jan 25, 2002
Posts: 775
I have a different approach, but I don't know if it would help you. When I did the mock exams I found I got a lot of questions wrong because of what I didn't pay attention to in the code. Whenever I answered the question, I forced myself to go back and look at every modifier, and particularly made sure I identified static versus instance members. I'd ask myself if I'd seen something that would change my answer to the question.
I found that helpful, but your mileage may vary.


Reid - SCJP2 (April 2002)
Rob Petterson
Ranch Hand

Joined: Jan 23, 2002
Posts: 149
Thanks guys. I seem to be overlooking silly mistakes in certain bits of code. I think I need to get into some routine of double checking one line at a time to spot these pit-falls.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: correct method for reading code