Java Reference
In-Depth Information
Review Questions
1.
List the three required attributes of the <applet> tag.
2.
For an applet class to be viewed in a browser, the class must extend:
a. java.applet.Applet
b. java.awt.Panel
c. javax.swing.JApplet
d. Any of the above
e. a or b
3.
True or False: If an applet class defines main(),the browser will invoke main() when
the applet is instantiated.
4.
Of the following applet methods, which ones are invoked by the browser when the
applet is first initialized, and in what order are they invoked?
a. start()
b. init()
c. stop()
d. paint()
e. destroy()
5.
True or False: For security reasons, the bytecode for an applet must appear on the
same Web server as the HTML source code.
6.
True or False: The size of an applet is determined by the HTML page that embeds the
applet.
7.
True or False: The stop() method is invoked on an applet when the user clicks the Stop
button or selects the Stop menu item of the Web browser.
8.
What method does an applet use to obtain the value of an applet parameter?
9.
How is an applet parameter defined?
10.
True or False: The getCodeBase() method returns the URL of the server where the
applet's bytecode is located.
11.
True or False: The getDocumentBase() method returns the URL of the server where
the HTML page is located that embeds the applet.
12.
True or False: An applet can never access files on the local file system.
13.
How does an applet obtain a reference to its corresponding AppletContext object?
14.
True or False: The bytecode for an applet can be placed in a JAR file.
15.
True or False: All necessary files for an applet must be placed in a JAR file that is speci-
fied using the archive attribute of the <applet> tag.
Search WWH ::




Custom Search