This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
1)void method2() { String s1 = "hello"; String s2 = "Pal"; s1 = s1+s2;// #5 } Here after line #5 ,hello string get eligible for g.c, or never string literals get garbage collected? 2)Is it true that static and native members never get g.cted?
Dave Wingate
Ranch Hand
Joined: Mar 26, 2002
Posts: 262
posted
0
I'm not completely sure, but I thought that only methods (and not member variables) could be declared with the native modifier?
Hi, I think "Hello" is eligible for gc after # 5 because since string s1 now refers to different string "hello" is left without any reference so it is eligible or gc. please correct kareem