当前页面: 开发资料首页 → Eclipse 专题 → 看个菜鸟问题:
看个菜鸟问题:
摘要: 看个菜鸟问题:
public void actionPerformed(ActionEvent e)
{
static boolean b = true;
if(b)
frm.setBackground(Color.BLACK);
else
frm.setBackground(Color.GREEN);
b = !b;
}
提示这个这个错误:Illegal modifier for parameter b; only final is permitted,啥意思?
static 是不能用来修饰局部变量的
但,c里面可以阿
那我要实现b值只初始化一次,怎么办那?
去掉static!
放到外头