beautypg.com

3 hello world midlet, Hello world midlet – Siemens XT65 User Manual

Page 52

background image

Java User’s Guide

6.3 Hello World MIDlet

52

s

wm_java_usersguide_v12

Page 52 of 123

2008-02-25

Confidential / Released

6.3

Hello World MIDlet

Here is a sample HelloWorld program.

/**

* HelloWorld.java

*/

package example.helloworld;

import javax.microedition.midlet.*;

import java.io.*;

public class HelloWorld extends MIDlet {

/**

* HelloWorld - default constructor

*/

public HelloWorld() {

System.out.println("HelloWorld: Constructor");

}

/**

* startApp()

*/

public void startApp() throws MIDletStateChangeException {

System.out.println("HelloWorld: startApp");

System.out.println("\nHello World!\n");

destroyApp();

}

/**

* pauseApp()

*/

public void pauseApp() {

System.out.println("HelloWorld: pauseApp()");

}

/**

* destroyApp()

*/

public void destroyApp(boolean cond) {

System.out.println("HelloWorld: destroyApp(" + cond + ")");

notifyDestroyed();

}

}

This manual is related to the following products: