Hamid Virani

Ranch Hand
+ Follow
since Jul 26, 2005
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 Hamid Virani

Congrats!! Thats a cool score
15 years ago
Thanks Jothi.

I'll try after 3-4 days.
15 years ago
I went to www.certmanager.net/sun/ to confirm my address for the SCJP 1.5.

I clicked on the linl First Time Users and am trying to create the login. I gave the exam on 8th Feb 2007 from India Prometric center.

After filling all the details, it gives "We could not find a user meeting the specified criteria. Please review the criteria and try again." error

Does it take some time before my details would be available?
15 years ago
Hi Ranchers,

Today, I cleared my SCJP 1.5 exam. Thanks for all of you for your valuable suggestions.

15 years ago
Hi Gayatri,

If you are preparing for SCJP 1.5, you can buy "SCJP 5 Exam Study Guide" By Kathy Sierra and Bert Bates". The exam code for SCJP 1.5 is 310-055. This will be mentioned on the cover of the book as well.

If you are from India, the publication is by dreamtech press.
Can anyone explain the reason for the answer?

I found this statement Declare the Exception in the K&B book.
Can any one explain me this with some example.

The term "Declare the Exception" means declaring that a method throws an exeption.

For e.g.

above method declares that it throws FileNotFoundException

The question give is:

x = 0
if(x1.hashCode() != x2.hashCode()) x = x +1
if(x3.equals(x4) == false) x = x+ 10;
if (x5.equals(x6) == true ) x = x + 100;
if (x7.hashCode() == x8.hashCode()) x = x + 1000
System.out.println("x = " + x)
If output is "x = 1111", which of following statements will always be true?

Answer given: x2.equals(x1)
Explaination: By Contract if two objects are equal then their hashcode must evaluate thenm to be ==

But, according to me, since o/p is 1111, all the above if condition will evaluate to true and hence x.hashCode() != x2.hashCode() which is contradicting the explaination.

Can someone tell me that whether there is an error of mock exam, or am I missing something important?
I think that the explaination contradicts with the answer, though answer seems to be right, i.e. Number version of the method will be called. The reason is that int will be boxed to Integer and since there is no Integer version of the method, it has to widen and choose between the "Number" version and the "Object version" and since "Number" is the "most-specific" version of the overloaded method, it will be called.

You can refer What is a most-specific method? from ths SCJP FAQ of javaranch.

Hope this helps.
This is a question from JMMock.

Code Fragment : List < ? > l = new ArrayList< Integer > ();


a. This code fragment will not compile
b. Nothing can be added to this List.
c. Any reference type could replace Integer on the right hand side.

The answer states that b and c are true.

There is no doubt with c, but for b, when I answered the question I thought that null can still be added to the list and so answered "b" as false.
If this type of question comes in the exam, should it be answered true or false based on this?
We are using NTLM Authentication filter. Is it possible that this is what is interfering? But, it did not gave any problems with 8.1 SP4
16 years ago
One more thing that I discovered is when there was an redirect in SP4, only one GET request was sent by IE, but with SP5 IE has to send 2 GET request to the same resource(identical requests) to get Http 200 ok response. But sometimes IE only sends 1 GET request and that is when we get "page not found" error.
16 years ago
Hi All,

We had been using weblogic 8.1 SP4 for quite some time. Now we have upgraded to 8.1 SP5.

After upgrading, whenever request.sendRedirect() method is used, on some Internet explorer it shows page not found. when we refresh it again it shows proper page. This does not happen when requestdispatcher.forward() style is used.

This error is removed if on IE Tools->Advanced Option->Show HTTP friendly message is unchecked. But this cannot be solution, because each client has to be updated with this setting.

The thing is that this is not a problem with SP4.

Please let me know if someone has this kind of problem or know any solution.


16 years ago

isnt explicit downcasting allowed in java ???

When you do the explicit casting, it will allow the code to compile. But at runtime if they are not compatible, a ClasscastException will be throw.

If instead you had declare B b = new C(); then it would have worked.