Null pointer Exception
Hi everyone,
Please help me solve this problem. I have no idea why is this exception coming. i have pasted the code here. the code compiles then i get an error saying - startApp threw an exception, Null pointer exception
publicclass MessageDigestextends MIDletimplements CommandListener{
private Command exitCommand;
private Command enterCommand;
private TextBox t;
private Form form;
private Display display;
public MessageDigest(){
display.getDisplay(this);
exitCommand =new Command("Exit",Command.EXIT,1);
enterCommand =new Command("Enter",Command.OK,1);
form =new Form("Message Digest");
form.addCommand(exitCommand);
form.addCommand(enterCommand);
form.setCommandListener(this);
}
publicvoid startApp()throws MIDletStateChangeException{
display.setCurrent(form);
}
publicvoid destroyApp(boolean unconditional){}
protectedvoid pauseApp(){}
publicvoid commandAction(Command c, Displayable s){
if(c==exitCommand){
destroyApp(false);
notifyDestroyed();
}elseif(c==enterCommand){
long dateTime = 28345;
MD5.msgDigest(dateTime);//calling another class file MD5.java
System.out.println(dateTime);
}
}
}
Thanx

