This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / Is there anything wrong with this code? No object refers to KKMultiServerThread after it is created. Will it be removed by garbage collector?
-std(std);
2001-9-18
{561}
(#204419@0)
-
help me! The code is very simple!
-std(std);
2001-9-18
(#204461@0)
-
An instance of KKMultiServerThread will not become eligible for gc before it's terminated. Keep in mind, the new thread created by JVM calls KKMultiServerThread.run() method. You didn't say what happened.
-doors(道士);
2001-9-18
(#204490@0)
-
you mean the Thread is refered by the JVM. Ok! Let's try an other exampleimport javax.swing.*;
public class testf
{
public static void main(String arg[])
{
JFrame f;
(new JFrame("god")).show();
System.out.println("Hello");
}
}
-std(std);
2001-9-18
{210}
(#204511@0)
-
Sure, each window is owned by an independent thread. What's your point?
-doors(道士);
2001-9-18
(#204519@0)