• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A humble request for your process

 
Brian Brumpton
Ranch Hand
Posts: 40
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I'm studying for this exam, I'm quite sure that I need, yet still haven't found the best way to approach analysis of the code you're presented with in the exam. If anyone (Roel De Nijs and any others who have passed the exam) would be willing to share their approach, e.g., a mental checklist you go through, I know I, and I'm sure many other future exam aspirants, would be eternally grateful.

I don't have any specific question in mind. What is it, in general, you do when presented with a block of code. How do you systematically break it down?
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Brian (and all other exam aspirants),

If I understand correctly, you are mainly looking for some tips to analyze the code snippet of an exam question in the most effective manner. I think already a few threads contain a bunch of tips to efficiently manage your time on the exam (and what you can do if your running out of time). Here and here and here

I think from a time management point of view, it's very important to first glance at the possible answers. If you don't see "compilation fails", you know you don't have to look for compiler errors. If it is in the list, first check the code for compiler errors. Because it really would be a pity if you spend 5 minutes on processing a complex loop and then discover a variable is used outside its scope.

To evaluate the code (rather) quickly, you'll need a good knowledge of java and its basics. If you don't know the rules for e.g. method overloading or method overriding, you'll lose precious time on the exam. That's quite obvious, I think. Give yourself enough time to prepare. Don't rush! My personal opinion: the journey becoming certified is much more important than that piece of paper itself. If you take your time to prepare, you'll become a much better developer with a good understanding of Java and OO basics. You'll get much more out of your certification than someone who's preparing to just pass the exam. No doubt!

Finally, preparing for a certification exam is like driving a car, you don't learn it by just reading a study guide and a few online tutorials! No, you have to practice, practice a lot! The more you'll practice, the easier it will get to analyze code and spot (compiler) errors and/or runtime exceptions. You need to get your hands dirty and try to write as many little programs as you can. Every mock question, code snippet,... you encounter could be an excellent starting point for a experimenting and twiddling (change access modifiers, make it final, make it static,...). I'm a strong believer of using your favourite text editor and javac/java to write, compile and run these little code snippets. Don't use an IDE, certainly not if you are a Java beginner! The IDE will spot compiler errors for you, but on the actual exam you don't have a compiler to point you at the errors, you have to do this all by yourself!
And that's the crucial part of the experimenting and twiddling with the code snippets: you make a small change to the code and you have to explain yourself what the result of this change will be (compiler error, runtime exception, same/other output). Then you compile (and run) the program and see if you were correct or not . This is something I try to encourage here in these forums as well: you'll find plenty of threads where someone asks a question or has some doubts, I (try to) answer the question or clear the doubts and then I add the same code snippet (as in the original post) but with 1 (or 2) small adjustment(s).
And the more mock questions you'll answer, the better you'll get in answering questions (and analyzing code as well). Practice makes perfect! When I took my first certification exam (SCJP 1.4) I had almost 2 years of Java experience as a (junior) Java developer. If I got the same exam today, I would (probably) finish the exam (a lot) faster. Simply because I now have 10 years Java experience, have already taken 4-5 certification exams, have been a (technical) reviewer for a few certification study guides and being (very) active on these forums.

And if you would be running out of time for whatever reason, don't forget: there is no negative marking, so you can have a free guess (and maybe score an additional point or 2 ).

Hope it helps!
Kind regards,
Roel
 
Brian Brumpton
Ranch Hand
Posts: 40
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roel,

As usual, some sage advice. I've been heavily focused on coding and more coding. I'll review each of the posts you have linked. As someone who is not a developer by trade, I feel I'm at a slight disadvantage because I don't code all day everyday.

I still get hung up on some questions because the code is written in a way that I haven't seen regularly (and probably won't after the I pass the exam ).

Given:

What is the result?

For some reason when I saw this and was doing my mental walkthrough identifying the parts and pieces line 3 didn't make sense to me. I read it as an object instantiation of some sort, not an instance variable. Obviously, that makes affects how I interpret the output of the code. I'm sure with more practice I'll see the parts an pieces more clearly and more quickly.

I'll share this link with my classmates who are also struggling with what to do to best prepare for this exam.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Brian Brumpton wrote:I still get hung up on some questions because the code is written in a way that I haven't seen regularly (and probably won't after the I pass the exam ).

That's true! Probably one of the biggest criticisms at the certification exams. The other one: you have to nitpick code and check for compiler errors while everybody uses an IDE during development which notifies you of compiler errors. Therefore it's important to code as much as possible and really think out of the box when coding, no code is silly enough And of course the mock exams/questions will familiarize you with the format and the (strange) code you'll probably (and hopefully ) will see only on the exam

Brian Brumpton wrote:For some reason when I saw this and was doing my mental walkthrough identifying the parts and pieces line 3 didn't make sense to me. I read it as an object instantiation of some sort, not an instance variable. Obviously, that makes affects how I interpret the output of the code. I'm sure with more practice I'll see the parts an pieces more clearly and more quickly.

Another tip: if you want to instantiate an object, you'll need the new keyword. No new, no object instantiation! That's pretty simple and straightforward. But like with any rule, there are a few exceptions:I created 3 objects, but didn't need to use the new keyword. So String objects can be created without using new and thanks to autoboxing, you'll can create objects of the primitive wrapper classes as well without using new.

Brian Brumpton wrote:I'll share this link with my classmates who are also struggling with what to do to best prepare for this exam.

Certainly do! And let them make a CodeRanch account and participate with this amazing community as well I'll add another tip I didn't mention in my previous post. For some questions (mainly "how many objects are eligible for garbage collection") it really helps to make just a simple drawing of the code. Examples here, here and here.

Hope it helps!
Kind regards,
Roel
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic