当前位置: 代码迷 >> Eclipse >> 菜鸟:Illegal modifier for parameter dis; only final is permitted是咋回事呢
  详细解决方案

菜鸟:Illegal modifier for parameter dis; only final is permitted是咋回事呢

热度:386   发布时间:2016-04-23 12:27:16.0
初学者: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类可类型不能被改写
  相关解决方案