Dinesh Tahiliani

Ranch Hand
+ Follow
since Aug 06, 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 Dinesh Tahiliani


The two references disp and show live on the stack and will be removed when the main method is done

I am not able to get this.

As far as i know objects references live on heap and methods and local variable on stack.

Can you please help me to understand this sentence which you have written. Please
In simple what does mark does and sweep does?
Please answer .


I have corrected the code

When i execute the prog i see the output as "alok alok". I am not getting how it is printing two times. Can you please explain in brief please

Also you told that one object is eligible for gc . which is that object?
According to me it should be disp. But disp is eligible i am not able to understand.
Correct me if i am wrong.

Ranchers it would be great if you could explain above scenario in simple terms. Please......

On what concept garbage collector works ?
What is the concept of memory sweep?

please ranchers explain this concept in brief

Thanks in advance
class A

public static void main(String []a)

String disp = new String("dinesh");
String show = new String("alok");

disp= show;



How many objects are garbage collected?

Please javaranchers help me out in understanding this concept...

Thanks In advance
You mean to say only one servlet instance and 10 different threads.

What do you mean different in Single Thread model.
Can you give me summary of that please
I didn' get you .

14 years ago
Not getting, can you please expalin with example.
A humble request please....
You mean to say that set uses equals() mtd to compare the object and doesn't allow duplicates?
Yes, but not able to understand
Can you please help to understand by example
I have heard in c and c++ of virtual decontructor and constructor, but not in java.

When i open servlet application on ten different computers ,
1. how many nstnaces of servlet will be created
2. How many threads will be created.

Can yoou please explain me in detail.

Please. .....
Hello Ranchers,

How can i catch error in jsp?
When i open suppose a jsp page and while opening it caught error , how can i show to user that error is been occured.
Please expalin in detail
14 years ago
Hello Ranchers,

Can you explain me wait(),notify() and join() mtd with example. Is it compulsory to call wait on object reference.
Why wait() is included in object class and sleep,yield mtds in thread class.