here it is printing yx.i did not understand why it is printing x here because when system.gc() is called only at that time finalize() method is called and hence name contains y so y should be printed what is happening here??
SCJP 5.0<br /> <br />"Skills are started with learning and mastered with improvement. Nothing is hereditary except death" BUDDHA...
If you add another object in method m() eg B z=new B("z"); as last. Output will be z y x. So probably thats how GC delete objects as kind LIFO last created first destroyed, but I m not sure.