初学者:Illegal modifier for parameter dis; only final is permitted是怎么回事呢?
我是eclipse初学者,请问一下提示错误:Illegal modifier for parameter dis; only final is permitted是怎么回事呢?我都是按照教程来的。。。
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Form;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
public class midlet1 extends MIDlet {
public midlet1() {
private Form frm=new Form("请您选择相应的操作");
private Display dis;
private Command cmdDel = new Command("删除该号码",Command,SCREEN,1);
private Command cmdEdi = new Command("编辑该号码",Command,SCREEN,1);
private Command cmdExit = new Command("退出该程序",Command,SCREEN,1);
private Command cmdBack = new Command("返回上一页",Command,BACK,1);
}
protected void startApp() throws MIDletStateChangeException {
dis = Display.getDisplay(this);
dis.setCurrent(frm);
frm.addCommand(cmdDel);
frm.addCommand(cmdEdi);
frm.addCommand(cmdExit);
frm.addCommand(cmdBack);
}
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
}
protected void pauseApp() {
}
我是初学者,希望各位帮帮忙。。。先谢过了。
[解决办法]
final类可类型不能被改写