Showing posts with label start(). Show all posts
Showing posts with label start(). Show all posts

Monday, 17 February 2014

INITIALIZATION AND TERMINATION OF APPLET IN JAVA

APPLET INITIALIZATION AND TERMINATION

When an applet begins, sequence of methods are:
1. init( )
2. start( )
3. paint( )
When an applet is terminated, the sequence is:
1. stop( )
2. destroy( )

init( ) :

  • The init( ) method is the first method to be called.
  •  Initializing the variables.
  •  This method is called only once during the run time of the applet.

Friday, 24 January 2014

CREATING A THREAD

CREATING AND STARTING THREADS IN JAVA

What are the two different methods of creating a thread in Java? What method must be implemented in either case?


In Java, an object of the Thread class can represent a thread. Thread can be implemented through any one of two ways:

                          1.You can implement the Runnable interface.
                          2.You can extend the Thread class itself.