Re: [問題] 解構的順序
※ 引述《superlubu (叔叔你人真好)》之銘言:
: public class c extends b {
: public c() { System.out.println("instance of class c, created."); }
: protected void finalize() throws Throwable {
: System.out.println("instance of class c, finalized.");
: }
: public static void main(String arg[]) throws Exception {
: c obj = new c();
: obj = null;
: System.gc();
: Thread.sleep(6000000);
: }
: }
: 結果如下:
: instance of class a, created.
: instance of class b, created.
: instance of class c, created.
: instance of class c, finalized.
呵, 要呼叫 super.finalize() 才行啊
http://farm3.static.flickr.com/2007/2334136379_5d6b7a484d_o.png

(tij, p333)
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.133.80.216
推
03/15 19:44, , 1F
03/15 19:44, 1F
討論串 (同標題文章)
本文引述了以下文章的的內容:
問題
1
1
以下文章回應了本文:
問題
1
1
完整討論串 (本文為第 5 之 8 篇):
問題
1
1
問題
1
1
問題
1
1
問題
1
1
問題
2
3
問題
1
4