Pal Sudarshan

Ranch Hand
+ Follow
since Jun 10, 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 Pal Sudarshan

Mr. Dan Chisholm, in the mock examDan Chisholm explains that LinkedHashMap organizes elements according to the hash method but also maintains order of insertion with a linked list. Please explain the implementation details of LinkedHashMap. I am thinking that it can either have a list based on the hashcode or a list based on order of insertion, but how can an implementation guarntee both properties concurrently? I think they would probably use two linked lists to get the desired behavior from LinkedHashMap. How do you think Sun implemented LinkedHashMap? Is it possible to have one linked list which keeps track of hash buckets and order of insertion or do we need two linked lists?

17 years ago
Hello All,

I had posted this very question long time ago, but I wasn't clear with my
question. Well, I wanted to know which methods I ought to study from the
String, StringBuffer, Thread, and the Collections Framework. Sun is very clear about which methods I need to know from the Math and Wrapper classes but does not state much for the classes String, StringBuffer, and Thread. There are a lot of methods from these classes which I have never used. Which methods should I study from the three classes I mentioned and the collections framework?

Hi All,

1) Has anyone been able to devise a way to memorize the precedence table?

2) I have been taking mock exams and sometimes the authors ask detailed questions about classes such what exception a certian method throws. How can I learn all the methods of all the fundamental classes, wrapper classes, and String class and know which exception each method throws? Is there any way to narrow down my study.

Joyce, the reason I wanted a UML editor is to make the inheritance diagrams
for collections framework. If I actually draw out the diagrams myself, I learn the concepts better than just looking at the diagrams.
As always, thanks for an excellent post Corey.

Can we write code to synchronize on a java class? If so, what is the difference between synchronizing on a class and an object?

I would greatly appreciate an illustration with an example.

Can anyone give me a direct link to free SCJP 1.4 practice exams from Sun?
Thank Corey. I think you are correct. The code would only make sense if these were special symbols.
Here is another example:

This post is converting '>' to '>'. Is '>' an escape sequence?
It is a modified example of Prof K's exam. I am not sure if I can post that on there. Is > some kind of escape sequence?
str is a reference in your code that points to "hi"
str -> "hi"

Then you are assigning str to a different object (mem location)
"hi" is not the same object as "hihello"

str + "hello" is a new object, so
str -> str + "hello" "hi" now has no reference

str.concat("hello") doesn't change the str, but then you are assigning
str = str.concat("hello") to a new object.