Back to project page androidtestdebug.
The source code is released under:
MIT License
If you think the Android project androidtestdebug listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
import java.lang.Thread; //from w ww. j a va 2 s . c om public class gcdemo { public static void main(String[] args) throws Exception { generateGarbage(); System.out.println("???gc???????DemoClass??"); System.gc(); Thread.sleep(1000); System.out.println("???gc????finalize??????????"); System.gc(); Thread.sleep(1000); System.out.println("???gc??"); System.gc(); Thread.sleep(1000); } public static void generateGarbage() { DemoClass g = new DemoClass(); g.X = 123; g.testMethod(); } } class DemoClass { public int X; public void testMethod() { System.out.println("X: " + new Integer(X).toString()); } @Override protected void finalize () throws Throwable { System.out.println("finalize????????"); // ??????????????? super.finalize(); } }