Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Vishal Singh

Greenhorn
+ Follow
since Feb 13, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

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.