+ Follow
since Apr 03, 2000
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 girish

Hi Vivek(bhaiya),
Can u send me ur e-mail address at
I would like 2 discuss this in more detail
Thanks Maha,
Why is this e-mail link not working?
Can u write ur mail address so that I can contact u?
thanks Surya.
You surely find me any servlets/jsp etc.
YA I will mail that que to one of moderator and find out
ans for it.
See u
Hello everyone,
I passed scj2p today with 85%.
Thank you for the valuable guidence I got from u all.
Especially Anna , tony ,jim and all.
The questions I found were quite easy and available mock exams
gave me good idea.
However I found only one que on awt which I had prepared most.
I even found a question on streams related to Socket .
I found one fill in the blank question which I feel is wrong.
Moderators if you permit I would like to discuss it.

This is the question from practice questions in Exan Cram.
Here is a method that creates a number of String objects in the
cource of printing the countdown
1 public void countDown()
2 {
3 for(int i=10;i>=0;i--){
4 String tmp=Integer.toString(i);
5 System.out.println(tmp);
6 }
7 System.out.println("BOOM");
8 }
When the program reaches line 7,how many of the String objects
in line 4 are eligible for garbage collection?(Assume the System.out does not keep a reference)
a. none
b. 1
c. 10
d. 11
Answer given is c(10).
They say d is incorrect because eventhough tmp is out of scope in line 7, the local var still has reference to String created.
What I feel is ans should be 11 since tmp is out of scope at line 7 it is eligible for gc.
Why is it given wrong
Pl help me.
Thanks Anna ,
That really clears my doubt.So static methods are not overridden.
Thanks once again .
Looking forward for same cooperation ahead.
When you use setVisible() for a frame without using setSize()
what happens is the frame is seen on left top in minimised form.
The setSize() gives it the size so that it is not in minimised
state when application starts.
This is what I understand.
The StringBuffer class (String aswell)inherit equals() method
from Object class.
The important difference is String class overrides this method
to do character by character comparision.
Whereas the StringBuffer class doesnot override this method.
So your ans gives they are not equal.
Betty ,
Is this test on the net.If yes pl let me know the address .
I would like to try it.
Thanks in advance.
Good Luck for your exam.
Sorry Anna I broke the tradition.
Ok let us discuss.
According to Jims post , the statement
Static methods may not be overridden is true.
But your code:
class Parent {
static void staticMethod() {}
static final void staticFinalMethod() {}
void instanceMethod() {}
final void instanceFinalMethod() {}
class Child1 extends Parent {
static void staticMethod() {}
static final void staticFinalMethod() {} // You can't hide like this.
//You violate the law
void instanceMethod() {}
final void instanceFinalMethod() {}
//You can't override like this
Here what is the statement:
"static void staticMethod() {}"

in Child1? Is it overriding or hiding.

Morever the compiler error like:
"Cannot override static methods with instance methods "
doesn't it suggest you can override static methods with only static methods.
Actually what I mean is - Is overriding not a subset of hiding.
Hope u understand the question.I think i have messed up many things.
Thanks Gary.That really solves my problem.
Maha- but the question still remains can static methods be overridden.
I think the answer to Art's question should be 1 & 3.
Actually I am confused .Please give detailed explaination as always.
I am a bit confused about locks obtained by threads.
My doubt is:
When a thread obtains lock on particular object ,
can other thread execute another method of that object which is not declared synchronized
Please help
What I feel is newly created object here is local to the main()
So it will be elligible for collection only after the scope goes
out of this main method i.e after completion of main method.
Some of the answers at the end of jargon test are of this kind:

20) Your answer:[ADE] Correct answer:[ADE<e></d>]
I am not getting the meaning of [ADE<e></d>]
Is my ans wrong ? plhelp me.