Question : Here is a method that crates a number of String
objects in the course of printing a sequence:
1.public void countDown()
3.for (int i=10;1>=0;i--)
5.String tmp = Integer.toString(i);
When the program reaches line 8 , how many of the String objects created in line 5 are
eligible for garbage collection?(Assume that the System.out object is not keeping a reference.
The answer given in the book is 10 .
I have a doubt over it . I think it should be 11.