本帖最后由 yin1031468524 于 2013-5-30 10:28 编辑
package com.yjb;
import java.awt.event.MouseAdapter;
import javax.swing.JButton;
public class Test {
public static void main(String[] args) {
JButton b = new JButton();
b.addMouseListener(new MouseMonitor(0));
}
static class MouseMonitor extends MouseAdapter {
private int j;
public MouseMonitor(int j) {
this.j = j; //为什此处可以使用this
}
}
}
在静态内部类里面为什么可以使用this? |