Thirumalai Muthu

Ranch Hand
+ Follow
since Oct 07, 2007
Merit badge: grant badges
For More
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 Thirumalai Muthu

Hi Is Knowledge of html required to pass the SCWCD Exam? I have some basic knowledge of html. please clarify? Thanks
No you cannot choose any difficulty level
Two objects will be "==" only if they are of the following types:

Integer(only within some range)

If the object is other than these types mentioned then two instances(objects)
will always not be "=="
Congrats... Please share your experiences and How you prepared for the exam it would be useful for others.
"==" Will always return false for two different objects so the first one will always be false.

Here it is said that the equals() and hashcode() have been overridden appropriately so if x.equals(y) is true then x.hashcode()==y.hashcode() will always be true so the answer can be

false true true


if x.equals(y) is false then x.hashcode() == to y.hashcode() can be true or can be false so so the answer can be

false false true
false false false(not in the options)

The option "b" is incorrect because if x.equals(y) is true then x.hashcode()==y.hashcode() has to be true.

"d and e" are incorrect because the first option cannot be true.
[ August 26, 2008: Message edited by: Thirumalai Muthu ]
Hi Congrats U did it atlast
15 years ago
Hi kurt HFSJ2 represents Head first Servlets JSP 2nd editiion right??
In the class above the equals() method has been overridden to make two objects of the same class to be considered meaningfully equal. The hashcode() method has Not been overridden, thats perfectly legal....The hashcode() method matters only if you want to put these objects of these classes into a collection and want to retrieve them...

Lets say for example

You have a HashMap collection in which you want to put objects of type TestTwelve(the above mentioned class) is the code

HashMap h=new HashMap();
h.put(new TestTwelve(3),new TestTwelve(5));//1
h.put(new TestTwelve(5),new TestTwelve(6));//2
//You try to retrieve the above objects as below
h.get(new TestTwelve(3));
h.get(new TestTwelve(5));

But the result will be rubbish since you cannot retrieve the objects which you inserted on lines1 and 2

So the thing is hashcode() and equals() must be overridden only if you are using your class as a key in a hashmap or any other collection class that uses hashcodes.

The code above is just comparing the two objects and saying its equal.It has nothing to do with collection classes... The other thing in the code is the 2 hashcode values returned are different and so these two objects land in different buckets(when collection is involved)

The contracts matter if collections are involved

[ August 21, 2008: Message edited by: Thirumalai Muthu ]
[ August 21, 2008: Message edited by: Thirumalai Muthu ]
Hi folks...I cleared SCJP 5 today and now want to take up SCWCD, but since I am new to the topics specified for SCWCD I want to know the preparation materials for this.. Thanks
Hi hariharan today I attended the SCJP 5 exam ..I did not encounter any fill in the blank questions, but there were around 10 drag and drop questions.
Hi Try to take as many mock exams as possible. By this way you can know your weaker sections and you can improve on that. First take the Master Exam which is included in the CD that accompanied the K&B book, then go for other mock exams.
15 years ago
Hello everyone today I cleared SCJP 5 with 70 %. I am very happy about this result but I am not able to login to the Sun Certification database. Can anyone help?
15 years ago
Validating arguments to a public method is not considered appropriate because Public methods are interfaces to your class and anyone can call your public method so you have no control over it and anyone can use a negative number to call your public method in this example unless you mark the method private.

You can use assert in public methods, its legal but its not appropriate .

The code compiles and runs fine in this case.
[ August 21, 2008: Message edited by: Thirumalai Muthu ]
Howdy folks...Today I gave the SCJP 5 Exam and secured 70%. I am very happy with this..I would like to thank everyone in this forum for their support and I would also like to thank kathy and bates for writing such a wonderful book. Thanks once again
15 years ago