girish,
You are partly correct. In the sense, all method level scope references WILL be eligible for garbage collection after the method returns. This is true provided you don't keep the copy of the reference to another var which is still known to the program. For example assigning the local object's reference to a class/instance level var or making a copy and sending it as a return value of this method. Assuming we don't keep any extra reference to the local object, we CAN't say that all local objects in the method are eligible gor GC ONLY when the method returns. It is not true. You as a programmer can
suggest for the GC that you don't need a particular object and the GC can collect that object's memory by
setting all the references of the object to null. So assuming the method you called does some time consuming work and it doesn't come out at all, or it takes a longer time to finish, (Example painiting the user screen pixel by pixel ), does it mean you can't clean up the object's created inside the method at all before the method comes out ? No it is not true. Assuming the
thread which run's the time-consuming work is not
a selfish thread 
and it does allow other threads to run by means of yield() /sleep() etc, then there is a very good chance for the low priority GC thread and collects all the objects which are not any more referenced by this program. So you make use of this feature by setting all your unwanted objects to null immediately whenever you are done with your object
inside the method itself. Which means if at all the GC does its work
before the time consuming method comes out , the GC CAN collect all the objects without ref which are inside this method.
Rekha,
In your code the object created inside the println(..) statement is eligible for GC as soon as the println is over.(Assuming the println(..) doesn't keep another reference to this object. I will check the source code of println(..)

). The reason I had explained in the above paragraph. Please go through it. The simple reason is there is no more reference to it. The JLS says only this. Whenever a object loses all its reference , it is eligible for GC. That's all. JLS doesn't force the mechanism of the GC . It differs from JVM to JVM. The qstn here is when is an object WILL BE ELIGIBLE for GC if at all GC runs. I did some research using SaiRam's code under JDK 1.2.2 in win98. It turns out that when a object loses all its ref it is eligible for GC. So both the anononymous object and the var inside this object(a) are eligible gor GC.
SaiRam,
I played well with your code. Here is the benchMark of the results.
1. If a object is created inside a method and if it does not have any ref it is eligible for GC. As you did you can suggest the GC to do the clean up by saying Runtime.getRunTime.gc(). IF it honours our request the memory WILL BE released before the method returns.
2. Before a method returns, when you keep the reference to all obects created inside a method (not setting them to null) , and call Runtime.getRuntime.gc(), it doesn't have any effect. The object's memory will not be released.
3. When you increase the no. of objects created, inside the method, more memory will be hogged by the system.
4. GC doesn't resolve the circular refs. (i.e) If a obejct is set to null and if it has another instance var as a reference to another object, the
referenced object is eligible for GC in the next RUN of GC.
regds
maha anna
[This message has been edited by maha anna (edited April 15, 2000).]