0% found this document useful (0 votes)
371 views3 pages

21 Question Related To Applet

An applet is a special type of program embedded in a webpage to generate dynamic content. It has a lifecycle defined by five methods: init(), start(), paint(), stop(), and destroy(). Applets run within a web browser and extend the java.awt.Panel class. The init() method performs one-time initialization, while paint() handles drawing and is part of the AWT. By default, applets use a FlowLayout and are executed via HTML or the applet viewer tool.

Uploaded by

Prashant kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
371 views3 pages

21 Question Related To Applet

An applet is a special type of program embedded in a webpage to generate dynamic content. It has a lifecycle defined by five methods: init(), start(), paint(), stop(), and destroy(). Applets run within a web browser and extend the java.awt.Panel class. The init() method performs one-time initialization, while paint() handles drawing and is part of the AWT. By default, applets use a FlowLayout and are executed via HTML or the applet viewer tool.

Uploaded by

Prashant kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Question related to Applet

1. What is Applet?

Ans:
It is a special type of program that is embedded in the webpage to generate the
dynamic content

2. Define lifecycle method of Applet in java?

Ans:
To control applet program java provide 5 predefined method which is known as
life cycle of applet. They are
i) Init()
ii) Start()
iii) Paint()
iv) Stop()
v) Destroy ().

3. How to execute the Applet program?

Ans:
Applet program can execute by web browser.

4. The immediate super class of the Applet class?

Ans:
java.awt.Panel is the super class of Applet class.

5. What is the role of init() method under applets?

Ans:
It is used to initialized the applet which invoked only once .In this method some
block of statement perform one time operation.

6. Which method is called by Applet class to load an image?

Ans:
Using the getImage() Methods
7. How does applet recognize the height and width?

Ans:
<APPLET> is a predefined tag present in HTML. This tag having two attributes
I.e. height and width which recognize the height and width of applet.

8. What is the default layout of an applet?

Ans:
FlowLayout is the default layout of Applet.
9. How Applet program can run?

Ans:
There are two ways to run an applet. They are
i) by html file
ii) by applet viewer tool.

10. Applet package contain how many class?

Ans:
Applet package contain only one class.

11. Define Standalone application?

Ans:
A standalone application is one which runs in the context of local disk and whose
result is not shareable. Every standalone application runs from command prompt
and it contains many method along with System.Out.Println statement.

12. Define Distributed application?

Ans:
A distributed application is one which runs in the context of browser or world
wide web & it can be accussed across the globe.it does not contain main method
and System.out.println statement.

13. Which method call for a single time?

Ans:
i) Init()
ii) Destroy()

14. Which method comes under awt?

Ans:
The Paint() method comes under awt.

15. State which class provide how many life cycle method?

Ans:
java.applet.Applet class provide s 4 life cycle method and java. awt . component
class provide 1 life cycle method.

16. What is java plug in software?

Ans:
java plug-in software is responsible to manage the lifecycle of an applet.

17. What is the use of applet?


Ans:
Applet is mostly used in Games and Animations.

18. Which method use to display the image?

Ans:
java.awt.Graphics class provide drawImage() method to display the image.

19. Which class implements upon ImageObserver interface?

Ans:
The component class implements upon Image observer interface.

20. Which class extends the applet class?

Ans:
JApplet class extends the applet class.

21. Which method use for painting operation in applet?

Ans:
Painting operation in applet done by mouseDragged() method of
MouseMotionListener.

22. Which facility for communication class provide b/w applet?

Ans:
java.applet.AppletContext class provides the facility for communication between
applets.

23. Which method returns the object of Applet?

Ans:
getApplet() method returns the object of applet.

24. Which method returns the object of image?

Ans:

java.applet.Applet class provides getImage() method which return the object of


image.

You might also like