Hi Victor,
First lets start with the basics:
Variables are never eligible for garbage collection!
In
java, only objects can be eligible for garbage collection.
This is an important distinction because your question is worded incorrectly. It should read:
When is the object, originally referenced by sHello, eligible for garbage collection?
The answer to that is: immediately after setting the sHello variable to null. Why? Because the original object (string "hellllloo") has no references to it so the JVM makes the string eligible for garbage collection.
Regards,
Manfred.