Core Java - Interview Questions and Answers

391. The tag contains two attributes namely _________ and _______.

Ans : Name , value.

392. Passing values to parameters is done in the _________ file of an applet.

Ans : .html.

393. What tags are mandatory when creating HTML to display an applet.
a) name, height, width
b) code, name
c) codebase, height, width
d) code, height, width

Ans : d.

394. Applet’s getParameter( ) method can be used to get parameter values.
True. / False.

Ans : True.

395. What are the Applet’s Life Cycle methods? Explain them?

Ans :
init( ) method - Can be called when an applet is first loaded.
start( ) method - Can be called each time an applet is started.
paint( ) method - Can be called when the applet is minimized or refreshed.
stop( ) method - Can be called when the browser moves off the applet’s page.
destroy( ) method - Can be called when the browser is finished with the applet.

396. What are the Applet’s information methods?

Ans : getAppletInfo( ) method : Returns a string describing the applet, its author ,copy
right information, etc.
getParameterInfo( ) method : Returns an array of string describing the applet’s parameters.

397. All Applets must import java.applet and java.awt.
True. / False.

Ans : True.

398. What are the steps involved in Applet development?

Ans :
a) Edit a Java source file,
b) Compile your program and
c) Execute the appletviewer, specifying the name of your applet’s source file.

399. Applets are executed by the console based Java run-time interpreter.
True. / False.

Ans : False.

400. Which classes and interfaces does Applet class consist?

Ans : Applet class consists of a single class, the Applet class and three interfaces: AppletContext,
AppletStub and AudioClip.

Post a Comment

Mới hơn Cũ hơn