1
已經導入弱引用但編譯器找不到符號,什麼錯? DumpReceiver.java中存在內存泄漏我認爲弱引用可能在使用後釋放?WeakReference符號找不到
import java.lang.ref.WeakReference;
Receiver r = new DumpReceiver(System.out);
WeakReference<Receiver> wr = new WeakReference<DumpReceiver>(r);
MidiInDump.java:64: cannot find symbol
symbol : constructor WeakReference(javax.sound.midi.Receiver)
location: class java.lang.ref.WeakReference<DumpReceiver>
WeakReference<Receiver> wr = new WeakReference<DumpReceiver>(r);
^
我同意(+1)。這是IDE告訴你的那種事情。 – 2010-12-09 08:24:56