source file name: AppletDemo.java

 /*
<applet code=AppletDemo.class width=300 Height=300 >
</applet>
*/
import java.applet.*;
public class AppletDemo extends Applet
{
  public void init() //initializtion
  {
System.out.println("init() works ");
  }
  public void start()  //start or resume execution
  {
  System.out.println("start() works ");
  }
  public void stop()//suspend execution
  {
     System.out.println("stop() works ");
  }
  public void destroy() //perform shutdown activities
  {
    System.out.println("program end ");
  }
 }

output: