John Donoghue

Ranch Hand
+ Follow
since Dec 20, 2007
John likes ...
Scala Mac OS X IntelliJ IDE
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 John Donoghue

In terms of a thread blocking itself, the answer is no. Java threads are reentrant. The same thread can enter multiple synchronized sections in the same object and will not block iteslf.
One issue to worry about is that the design is locking on separate objects. This raises the question of deadlock; it is possible to that one thread gets the lock on object1, and then the thread scheduler swaps it out for another thread. That thread gets lock on object2, and then blocks waiting for object1. The first thread starts to run again, and blocks waiting for object2--deadlock. I'd think carefully about this, and make really sure to document it for the examiner.

You could synchronize the blocks on *this*, if you don't want to synchronize the entire method. If the two methods are in the same class, why not just synchronize the methods instead? This seems like a much simpler solution to verify.
It is the accomplishment that matters--the score means nothing. You are a SCBCD.
14 years ago

Originally posted by John Donoghue:

It will take a few weeks for the official certification stuff to arrive. I'll post something when it arrives.

The certificate arrived today (yesterday, actually, I didn't get the mail until today).
It simply says SCWCD for version 5. No indication one way or another about the upgrade exam. This makes sense, because the certification guidelines say something to the effect of passing the new test or passing the old test and passing the upgrade.

Congratulations! Great score.
14 years ago
The general wisdom is that should never rely on finalize() to do any important processing (like closing a file). This is especially tricky for people linke me coming from C++ backgrounds, because it looks like a C++ destructor. Joshua Block's book Effective Java has a nice description.

The method is guaranteed to be called once. However, that doesn't mean that the object is garbage collected. Another object may hold a reference to it, making it "reachable", and so the garbage collector won't reclaim it, although finalize has run. On the other hand, the garbage collector may never run, and then

If you were going to call finalize() explicitly, it is probably better to either: just perform the shut-down logic directly in the code that would call finalize(), or have another method that is called explicitly. You can call it, or finalize() can call it, or both can call it (assuming you write it to be safe to call more than once).

If you want to make sure some resource is correctly handled (like shutting a file), take a look at addShutdownHook() in java.lang.Runtime. This registers methods that run as the JVM shuts down, regardless of how the shut-down is initialized (closing the GUI, the user pressing Cntl-C etc.). The SCJD book by Monkhouse & Camerlengo contains a nice description of it.
You want the second edition, by Monhouse and Camerlengo. It is published by Apress, and has an "ebook" version available (which I believe is pdf). The link to their site is:

Originally posted by Francesco Bianchi:
Have you ever calculated your on HFSJ mock? If yes, could you please tell it?

I took it the night before the exam and got a 58%, but a 92% on the actual test (the upgrade version 310-84).
When I took the first test (the 1.4 version, 310-81), I took it the morning before and got a similar score and it terrified me, but I passed the actual exam then. For me, at least, it was a bad indication of what I know.

On the other hand, I have also heard of many people who found the score to be really accurate.

What I found it VERY useful for was highlighting the areass that I needed last minute studying for--which method belonged to which interfaces and the deployment descriptor elements in my case.
14 years ago
Great score.
14 years ago
Brilliant score! Congratulations.
14 years ago

Originally posted by Mitch Miller:
I found HF 1.4 difficult, will try Lyons, for new test.

Don't be put off by the fact that the Lyons book has "1.4" in its title. The exam objectives are the same. I thought it covered the version 5 material very well.

Good Luck!
[ May 09, 2008: Message edited by: John Donoghue ]

Originally posted by Vishal Matere:
Just curious, Do they give Paper copy Certificate for Upgrade exam too?
(same like SCWCD main exam)

I sure hope so! I've got the frame ready and a nail in the wall.
This is the only upgrade test I've done. It will take a few weeks for the official certification stuff to arrive. I'll post something when it arrives.
Thanks for sharing you experience.
Do take a look at the Peabody On Patterns link. It is short and to the point. I found it quite helpful.

14 years ago