这个经典的HelloWorld程序为什么出错呢??(急啊!!)
我照着书写了这个j2me的helloworld 程序
可是有点问题我不知道怎么回事 请高手指点点??
import javax.microdition.midlet.*;
import javax.microdition.lcdui.*;
public class HelloWworld extends MIDlet implements CommandListener
{
private Command exitCommand=null;
private Display display=null;
private TextBox t=null;
public HelloWorld()//问题出在这里??
{
exitCommand=new Command("Exit",Command.EXIT,2);
t=new TextBox("Welcome","Welcome to the j2me magic world!",256,0);
t.addCommand(exitCommand);
t.setCommandListener(this);
}
public void startApp()
{
display=Display.getDisplay(this);
display.getCurrent(t);
}
public void pauseApp()
{
}
public void destroyApp(boolean b)
{
}
public void commandAction(Command cmd,Displayable dis)
{
if(cmd==exitCommand)
{
destroyApp(false);
notifyDestroyed();
}
}
}
出现的问题是 public HelloWorld()函数声明需要返回类型 可是我是照着书写进去的树上就没有啊?
请问各位高手是怎么回事 如果需要返回类型 那么是什么类型阿?
多谢了!!!