Andrew Ebling

+ Follow
since May 18, 2006
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Andrew Ebling

Anyone? I'm leaning towards starting out with 2.x and biting the bullet with the learning curve on this legacy technology...
Would you recommend someone new to EJB to start with 2.x or 3.0 at this time? And why?

EJB 3.0 appears to be simpler and therefore easier to pick up, but my guess is that 2.x will be used in the industry for quite some time to come. Conversely, is it worth investing a large amount of effort in learning 2.x if it is set to become a legacy technology?

Your thoughts and reasoning would be greatly appreciated.


Having passed the exam, I thought I'd provide feedback on my planned exam technique, for the benefit of those who haven't taken their exam yet.

My first pass through the questions took longer than I had planned. I then went back for a second pass and checked/completed all of the marked questions. After that I only had 25 minutes left for checking, which meant that I only really had time to check that I had given the appropriate number of answers for each question. I probably could have used another 20 minutes to half an hour for thorough checking.

So my advice would be to make sure you keeping timing under control on that crucial first pass through the exam. I found it took me about 15-20 minutes to really get "warmed up" or "into the zone". If I was doing the exam again, I would probably be more inclined to mark-and-skip any questions that weren't obvious straight away during this initial period.

With regard to the drag-n-drop questions, the situation is pretty much as described in the K&B book, but you do get a warning that informs that you will loose your original answer if you try and review a drag-n-drop question (note: you also get this warning if you have simply viewed the question! I would recommend using the whiteboard to record the drag-n-drop questions and ticking them off once they are complete, or only unmark the question when you have completed it). I suspect I probably dropped most of my marks on the drag-n-drop questions as a result of this basic usability issue. Very annoying.

One other tip - if you are based in the UK and are thinking about using the test centre in Reading, make sure you call them and check that the air conditioning has been fixed or use another centre. It got so hot in the test room I actually felt quite faint at times .

Note to moderators: please leave this thread in this forum, rather than moving it to the "success stories", as I think it will be useful for people who haven't taken the exam yet, who probably don't check the "success stories" forum so much.
Remember that the regex you supply to String.split() is for matching delimiters not tokens. This confused me for a while too and I don't think the JavaDocs make it clear until you get to the examples.
So my exam is tomorrow and I'm doing final prep and a few more mock exams.

I've been trying to figure out a good technique that is simple enough to memorise (as if I don't have enough to remember as it is!) and carry out under exam pressure.

I did a mock exam in exam conditions and tried out the suggested technique on pages xxxvi to xxxviii of the K&B book. This technique involves doing 4 passes through the exam. In particular the first pass is supposed to take less that 25% of the time, but if you work that out, it comes to about 36 seconds a question. Now I don't know about anyone else here, but it usually takes me that long to figure out if I should go straight for the "compile fails" option.

Also, with 4 passes through the exam, I feel I'm spending too much time going between questions and so am not able to focus properly. With this in mind, I'm leaning towards 2 passes, plus a final check.

What exam technique are you planning to use and why? If you have already taken the exam, what technique did you use and how did you find it?

One other thing - has anyone taken the exam at a Prometric centre recently? Have they fixed the bug which can erase your answers to drag-n-drop questions if you try and review them? Apparently Prometric only offer white-boards and dry markers (no paper and pencils allowed), so there won't be enough space to write out answers to drag-n-drop questions, as suggested in the K&B book.



Originally posted by marc weber:
Well, the SCJP exam is still $200 in the US...

And even more than that in the UK.

Originally posted by Sri Kan:
So far nobody told me about a question on this topic in the exam...

But nobody is allowed to discuss real exam questions with anyone else right? (Remember that legal agreement everyone has to click through?)
I agree there is some ambiguity, but I think most people would read the option as "try/catch blocks are not allowed in finally blocks".
I think that is wrong - I use try/catch in finally blocks all the time, especially when cleaning up network connections, closing OutputStreams and the like (many cleanup methods can throw IOExceptions).
Oh, and adding an "instanceof" check after reading the object back doesn't work either
So I wrote this test code to refresh my memory on serialization, but also because I was curious if you could deserialize parameterised/generic collections (I was expecting not since generics in Java only offers compile time protection against putting the wrong stuff in a collection):

As you can see, the line which reads the HashMap back generates a warning. The warnings go away if I simply attempt to cast it to a non-generic Map/HashMap. But what if I want to retain the benefits of generics after deserializing this collection, without generating a compiler warning?

What would be the safe/proper way to do this?



Originally posted by Sri Kan:
Strings in String pool are garbage collected.

Please see the following Javaworld page

OK, well I guess if it is that complicated and JVM specific, we are unlikely to see a question hinge-ing on this subtlety on the exam right?

Thanks for your help!

So I'm just reading about the String pool on page 419/420 of the K&B book and I have a question.

Do un-referenced elements in the String pool get garbage collected just like any other object?

The reason I ask is that if elements in the String pool get GC'ed shortly after they become unreachable, wouldn't that reduce the efficiency of the String pool?

On the other hand, if the String pool is never flushed of unused Strings, it could get very big indeed.

So in practice, are Strings in the String pool just like any other object from a GC point of view, or do they get some kind of special treatment? (e.g. does the GC only go after the String pool if it has exhausted all other options?)

From what it says on p420 about forcing a new String object using new String("my new string");, I take it that Strings made this way are definitely treated as normal objects, since they are allocated outside of the String pool?

I'd be very grateful if someone could clear that up for me. Thanks.

OK its worse than I thought - the Explanations sometimes aren't even correct either; the "X is correct" (where X is the letter(s) of the correct answer(s)) sometimes does not match the explanation given i.e. it says A is correct, but the explanation makes it quite clear that it is talking about option C!

I figured this out on a question about method signatures, in which only one option (C) contained the final keyword, but the correct answer was given as (A). The explanation for A explicitly mentioned why it was OK for the final keyword to be used in a method override.

I'm amazed this book got such good reviews on Amazon given that the practice exams advertised on the front cover are basically useless. I'm very disappointed.

Nitesh hit the nail on the head. If you actually want the code to wait (as opposed to throwing an exception), you need to have a lock on the object in question.