紧急求助,SUN源码分析
我想请各位帮个忙,分析以下一段SUN源码,我觉得很诧异,
所以想请各位帮个忙,答对绝对高分。
代码如下:
Object[] listeners = listenerList.getListenerList();
// Process the listeners last to first, notifying
// those that are interested in this event
for (int i=listeners.length-2; i>=0; i-=2) {
if (listeners[i]==ActionListener.class) {
((ActionListener)listeners[i+1]).actionPerformed(e);
}
}
分析listeners[i]==ActionListener.class和((ActionListener)listeners[i+1]).actionPerformed(e)中为啥Class和Object可判断“指针”相等性(越
深入越好);还有[i]和[i+1]判断两个不同对象。
谢谢各位!
最好将您的解答发到我的油箱zhangjiawang0809@263.net或
zhangjiawang0809@sohu.com。
请各位大侠尽量帮个忙。万分感谢!