A Ridolfi

Greenhorn
+ Follow
since Nov 25, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by A Ridolfi

Hello,

Simple question: Imagine I have a synchronized method in a class, and a thread has blocked it. There are 4 threads waiting to use that method, after it returns. Upon the method return, which thread will get it first? The first thread that was waiting, or there is no guaranteed order?

Thank you,
Alberto M.
Thanks for all the ideas about the approaches.

Roger, my brain gets slow after a long day of programming. Time to rest now. :-)

Rob, thanks for the tip. I will take that in consideration.

Thanks.
16 years ago
That's also a good idea Bill, iterating over the keys then getting the object, instead of using the normal Iterator way. Thanks for the suggestion.
16 years ago
Roger, I would never have thought of that. I'm going to look on the API right now! Thanks! (Of course I have looked, duh)

Jesper, thanks for the suggestion, that solves the problem. I was trying to solve the problem by looking for something like a getKey() on an Iterator or something like that, this entrySet() is a different approach but solves the problem. Thank you.
16 years ago
Hello,

I have an iterator looping through objects on a Map. I can retrieve objects using the Iterator's next(), but I need also to retrieve the key for the current entry, not just the value object. Any suggestions? Any help would be appreciated.

Thanks
Alberto Ridolfi
16 years ago
Thanks for all the support.

I started studying in October with K&B book, then startd taking Whizlabs on December. Took 3 mock exams on Whizlabs and read the book again. Was scoring around 60%-70% on Whizlabs before going to the exam. I think that if you score 90% on Whizlabs you can clear the whole exam.

Alberto
16 years ago
Thanks for all the help guys!

The exam is actually easier than Whizlabs; If you're practicing on Whizlabs, you're then good to go.

Next step: SCJD


Alberto Ridolfi
SCJP 1.5
16 years ago
For that you'd be better of writing the PPPoE module natively in C (or any other native language) and linking it with your Java application via JNI.

http://en.wikipedia.org/wiki/Java_Native_Interface

Cheers
Hello,

I have these classes

class javax.mail.URLName{ //does not implement serializable
protected String fullUrl; //won't serialize because class is not serializable
}

I need to serialize URLName, in particular the fullUrl field. However, I am subclassing it, and the subclass DOES implement serializable.

class URL extends javax.mail.URLName implements java.io.Serializable{}

My question is: When I serialize URL (sub-class of URLName), will the inherited fullUrl field be serializable also? Are public/default/protected inherited fields automatically serialized even though the super class don't implement Serializable?

Thank you
16 years ago