Win a copy of Rust Web Development this week in the Other Languages forum!

Eugenio Nassu

+ Follow
since Aug 09, 2004
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 Eugenio Nassu

I'm trying to see the Hibernate site before post some questions here.

Is it out ? Right now (11h26 GMT) I could not access it
On this code:

Why I'm getting a NullPointerException ?

((BigDecimal)b).intValue() is being evaluated ? It shound't be, as far I know...
12 years ago
Sun certification pages tells that we can use any final version (not beta) newer than 18 months. I think we can make the current projects with java 5 with no problems. It's very important to tell this on the docs, of course...
The voucher is not personal. To schedule a test, you need just the number printed. You can sell the voucher even online, just sending the number to the buyer.
You should take the newest version, 1.4
some 1.2 topics are not so interesting, awt and io.
we could expect an 1.5 upgrade exam next year. I'm not sure if the upgrade could be done from 1.2 to 1.5 in the future;
Great Score !!!

17 years ago
In this case, you must follow the "handle or declare" rule. The exception must be on method signature or must be enclosed by an try/catch block.

That's because Throwable includes Checked and unchecked exceptions.

RunTimeException is an unchecked exception, so the handle or declare rule does not apply.

Dan's mocks helped me a lot too... You should look at them
17 years ago
Congrats !

What's next ? SCJD ? SCWCD ? SCBCD ?
17 years ago
An assertion is an expression that evaluates TRUE, every time, at a fixed point on the code.


for( i = 0; i < 10; i++ ) {
// i >= 0 && i <= 9 is always true here


so, you could use assert to certify this:

for( i = 0; i < 10; i++ ) {
assert (i >= 0 && i <= 9);


When assertions is enabled, the expression is evaluated, and if the result is false, will throw an exception.

This is a tool to debug the code, and in production code, the assertions should be disabled, due to its overhead.
The main use of anonymous inner classes in Java is the Event Handler Classes.
When we build collections of abstract classes it can help too.
There would have no problems to declare every class to be used, but it'a a nice shortcut.
In my assignment:

"...They take bookings only within 48 hours of the start os room occupancy..."

I considered this indicates a not so big number of records, so the read all record approach makes sense for me...

I'm thinking the best way to store the records on client, not decided yet.
Great score !

Congrats !
17 years ago
Dan Chisholm, I made your mocks and I think they helped a lot ! Thanks for your effort on making that site !

best regards
17 years ago
I'm taking the same approach as Hanna. The record number is the position in file. So the recordNotFoundException makes sense. But I didi not realize if DuplicateKeyException will be thrown any time...