Java Applet Interview Questions and Answers Pdf - 1

Question: 1

What is the sequence of interpretation, compilation of a java applet?

A java program is first compiled to bytecode which is stored in a .class file.

This file is downloaded as an applet to a browser which then interprets it by converting it into machine code appropriate to the hardware platform on which it is running.

Question: 2

Which method is called by applet class to load an image?

getImage(URL object, filename) is used for this purpose.

Question: 3

How do I load a serilalized applet?

Instead of specifying the CODE attribute of an tag, you use the OBJECT attribute, as in

<APPLET

OBJECT = TheApplet.ser

WIDTH =300

HEIGHT = 300

This allows you to pre-initialize your applet to some saved state, instead of having to reinitialize your applet each time it is loaded.

Question: 4

What is the relationship between clipping and repainting?

When a window is repainted by the AWT painting thread, it sets the clipping regions to the area of the window that requires repainting.

Question: 5

How does applet recognize the height and width?

Using getParameters() method.

Related Questions