This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Garbage Collection

 
Vinod Sinha
Ranch Hand
Posts: 43
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
class Animal { //1
static int a=10;//2
public static void main(String args[]) { //3
callme(); //4
System.out.println("Hi"); //5
} //6
static void callme() //7
{ //8
System.out.println(a);//9
} //10
} //11
After which line is 'a' eligible for garbage collection ?
1) Line 4
2) Line 5
3) None of the above
 
Tamizh Selvan
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since 'a' is declared static, its scope is alive till the object persists. so the ans is obviously 3)none of the above
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic