Hi Muhammad,
"name" is a reference variable, not an object.
Java has two types of variables: primitive type and reference type.
A primitive type variable ie <code>int i</code> actually contains the value that is assigned to it.
<pre>
Memory
---------
int i = 10 -> | 10 |
---------
</pre>
A reference type variable ie <code>String name</code> contains the
memory address for the object that is assigned to it; not the object itself.
<pre>
Memory Memory
----------- ------------
String str = "Hello" -> | address | points to | Object |
----------- ------------
</pre>
Only the memory where objects are stored is garbage collect. The memory area containing variables is not.
Hope that helps.
Sorry ... haven't mastered ASCII art

hope you get the idea.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
[This message has been edited by Jane Griscti (edited June 20, 2001).]
[This message has been edited by Jane Griscti (edited June 20, 2001).]