girish

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

Hi Vivek(bhaiya),
Can u send me ur e-mail address at g_karachiwala@hotmail.com.
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?
Rgds
Girish
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
Rgds
Girish
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.
regards
Girish

gc
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.
Regards
Girish
Sree,
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.
Rgds
Girish
Himbandhu,
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.
rgds
Girish
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.
Rgds
Girish
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.
Regards
Girish
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.
rgds
Girish
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()
method.
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.