Vishal Singh

Greenhorn
+ Follow
since Feb 13, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Vishal Singh

Denver,
It is not necessarily true that a variable outside any method is an instance variable. This is because it could be a class (denoted by static) variable. Static or class variables do not belong to the instances but they belong to the whole class. An example of static variable would be a static integer that keeps a count of how many instances or objects you created in the program.
Hope it helped you understand the point better.

Vishal
Sunny,
I think you are all set!


Vishal
But Sunny,
object b ie. String b is still being referenced and returned at
line 6. So it wont be eligible for GC. Am i right?


Vishal
Excellent question Ankit.