Explain the life cycle
of an applet
Answers
✧Hey✧
♡♡ Answer♡♡
Applet life cycle defined as how the object created,started, stopped and destroyed during the entire execution of the application is said to applet life cycle.
Applet life cycle has 5 methods:-
➡init()
➡start ()
➡aint ()
➡destroy ()
These methods are invoked by the browser to execute.
✌I hope it helps you ✌
Answer:
Explanation:
Applet life cycle defined as how the object created, started, stopped and destroyed during the entire execution of the application is said to applet life cycle. Applet life cycle has 5 methods init(), start(), stop(), aint() and destroy().These methods are invoked by the browser to execute. Applet works on the client side so, less processing time.
Methods of Applet Life Cycle
Applet life cycle has 5 methods. Methods are init(), start(), paint(), stop() and destroy().
init(): init() method is used to initialize an applet. It is invoking only once at the time of initialization. Initialized objects are created by the web browser. We can compare this method with a Thread class born state.
start(): start() method is used to start the applet. It is invoking after the init()method invoked. It is invoking each time when browser loading or refreshing. Until init() method is invoked start() method is inactive state. We can compare this method with Thread class start state
stop(): stop() method is used to stop the applet. It is invoked every time when browser stopped or minimized or abrupt failure of the application. Afterstop()method called, we can also start() method whenever we want. This method mainly deals with clean up code. We can compare this method with Thread class blocked state
destroy(): destroy() method is used to destroy the application once we have done with our applet work. It is invoked only once. Once applet is destroyed we can’t start()the applet. We can compare this method with Thread class dead state
paint(): paint() method is used for painting any shapes like square, rectangle, trapezium, eclipse, etc. paint() method has parameter as ClassGraphics. This Graphics class gives painting features in an applet. We can compare this method with Thread class runnable state.